Jump to content

Creating a variable page pdf from graphics


carsong

Recommended Posts

I have one image for each letter of the alphabet.

 

My input data file looks like:

 

Text

Paris

Belgium

 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...