Jump to content

Repeat pages based on quantity in spreadsheet.


Recommended Posts

I've been trying to figure out the best way to approach a new project.

I have a spreadsheet from the client that lists a store and the names of the provided art in columns. Under each art name is a number for the required quantity of each. I've attached the spreadsheet and a sample art pdf.


The goal is to create a multipage pdf with the correct pdf art and the Store Number and Location in upper right corner. The trouble I am having is figuring out have to Fusion Pro repeat the page based on the number in the spreadsheet. For example, I need 25 pages created with the GIFT17-1G graphic for store 286. Following that would be 5 pages with GIFT17-1I for the same store. And so on through all of the graphics and store.The idea is that the printer can just output one big pdf file without having to sort and punch in individual quantities.


My first thought was to create a table with 1 cell per page and have it populate through overflow pages, but I can't seem to figure out how to repeat a table cell based on specific number in my data. I may be way off with that approach, though.


Not sure if any of this makes sense, but any suggestions greatly appreciated.


Edited by knaselk
Link to comment
Share on other sites

Assuming your PDFs are named the same as your fields, you could create a text rule:

var result = [];
for (var field in FusionPro.Fields) {
 if (!/^Store/.test(field)) {
   var count = Int(Field(field));
   while (count--)
     result.push(CreateResource('/path/to/graphics/' + field + '.pdf', 'graphic').content);
return result.join('<p verticalstart="topofpage">\n');

And set the text frame to use an overflow page like you mentioned.

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