Jump to content

Creating a variable page pdf from graphics


Recommended Posts

I have one image for each letter of the alphabet.


My input data file looks like:






I would like to create a 5 page pdf from the letters of the alphabet for record 1 and a 7 page pdf from the letters of the alphabet for record 2.


How is this accomplished?


I've tried a pdf with overflow page and text frame with rule returning tagged output here is the validated rule output:


<graphic file="80.gif" pagenumber = "1"/><P>
<graphic file="65.gif" pagenumber = "2"/><P>
<graphic file="82.gif" pagenumber = "3"/><P>
<graphic file="73.gif" pagenumber = "4"/><P>
<graphic file="83.gif" pagenumber = "5"/>


Here's my rule:


var string = Field("Text");
var markupToReturn = "";

string = string.toUpperCase();

for (var i = 0; i < string.length; i++)
   var resourceRef = CreateResource(string.charCodeAt(i)+".gif",'graphic' ,'no'); 
   markupToReturn += '<graphic file="'+resourceRef.name+'" pagenumber = "' + (i+1) + '"/>';
   markupToReturn += '<P>';    

markupToReturn = Left(markupToReturn, markupToReturn.length - 3);

return markupToReturn;

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.

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...