Jump to content

Multiple page PDF


rsheldon

Recommended Posts

I have a 21 page PDF; the first page is common and the back page(s) are driven by data. How do I tell FP to compose a PDF using in 1 instance page 1 and page 3, 4, 8 and 21 and in the next instance use page 1, 2, 6 and 18.:confused:

 

Thanks,

Rob

Link to comment
Share on other sites

Is this an external PDF that you're bringing in as a resource? If so, you can use a modified version of the multi-page PDF insertion rule:

http://forums.printable.com/showthread.php?t=37

You can modify the logic to return whatever pages you want with the pagenumber attribute of the <graphic> tag.

 

Or are these pages in your template PDF file? If so, you'll want to name each page in the Page Usage dialog, then you can use the FusionPro.Composition.SetBodyPageUsage() function in OnRecordStart to enable or disable the pages. There are a lot of examples of this on the forum.

Link to comment
Share on other sites

Dan,

 

Thank you very much for your response. The PDF Pages are part of my template. I have them named in Page Usage. The issue is, I have never had to set up a multiple page PDF like this. I searched the forum and all I could see was an instance of 3 or 4 pages. Can you point me in the right direction. Normally I would write a variable graphic rule (very long else if statement), I thought I would try a different approach.

 

Thank You,

Rob

Link to comment
Share on other sites

In that case, I would go in to the "Manage Pages..." dialog and name all your pages IDENTICALLY to the names of your associated fields in the data file (i.e. Page1="Section01"; Page2="Section02"; etc.) and I would check the box making all pages "unused". Then I would add the following code to my OnRecordStart callback rule:

for (var currPage=1; currPage<22; currPage++) {
  var currField = "Section" + FormatNumber("00", currPage);
  if (Field(currField) == "1") {
     FusionPro.Composition.SetBodyPageUsage(currField, true);
  }
}

Link to comment
Share on other sites

I learned by reading the code snippets on these forums, asking questions about code I didn't understand, and googling "javascript" plus whatever I wanted to do. It's not a difficult language to learn -- I'm having a much harder time with Mandarin. =)
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...