Jump to content

Frame around dynamic image


Recommended Posts

I am using a rule within a text box to dynamically pull in pdf images. I am wondering if there is a way to add a frame just around the image. I have defined the width but since the pdf pages are different sizes the frame does not adjust. Below is the rule I am using to get the images.

 

return "<graphic file=\""+Field("Order ID")+"_"+Field("Document ID")+".pdf\""+" width= 25000 pagenumber=1>"

Link to comment
Share on other sites

One way you could do that is to put your graphic in a table that has a border on it.

 

var width = 25000;
var graphic = '<graphic file="' + Field("Order ID") + "_" + Field("Document ID") + '.pdf" width="' + width + '" pagenumber=1>';

var myTable = new FPTable;
myTable.AddColumns(width);
var row = myTable.AddRow();
var cell = row.Cells[0];
cell.SetBorders("Thin","Black","Top","Bottom","Right","Left");
cell.Margins = {Top:1, Bottom:1, Left:0, Right:0};
row.SetContents(graphic);

return myTable.MakeTags();

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...