Jump to content

Complex challenge with PDFs

Recommended Posts

I have a challenge and have no clue as where to start:


  1. I have a client who produces about 5,000 discreet PDF files per day.
  2. The files vary in the number of pages per file from one to three.
  3. The client produces a .csv file with the file names of the PDF files.
  4. These files will be printed and inserted into envelopes using an automated mailing inserter.
  5. The inserter reads a barcode and uses the barcode to match the pages together as required.

My challenge is to place a unique barcode on each page. The barcode can include the file name and should indicate the number of pages.



Is there any way of doing this in FusionPro?



I am using MacOS Lion, Acrobat 10.1.3, FusionPro 8.1.2



I'd appreciate any ideas on this one

Link to comment
Share on other sites

Normally you can't access page number information in a rule to create a barcode, although I'm actually working on an enhancement to make this possible right now.


However, if the number of pages is based on a known value, such as the number of pages in a discrete* PDF resource, then you can do it. Since you know that the PDF resources will be only up to three pages, you can create three Unused Body Pages, then count the number of pages in the PDF resource, and populate a frame on each of the template body pages with a page of the PDF resource. And you can set a barcode with a specific page number on each of those pages as well.


This could all be driven by logic like this in OnRecordStart:

var r = CreateResource(Field("PDFResource"), "graphic");
for (var i = 1; i <= r.countPages; r++)
   r.pagenumber = i;
   FusionPro.Composition.AddGraphicVariable("Graphic " + i, r.content);
   FusionPro.Composition.AddVariable("Barcode " + i, Make128Barcode(r.name + "|" + i + "|" + r.countPages))
   FusionPro.Composition.SetBodyPageUsage("Graphic Page " + i, true)

The code above makes a lot of assumptions, including that you have pages with particular names, and each contains a text and graphic frame calling our variables with particular names.


* not "discreet," unless they're secret for some reason :p

Edited by Dan Korn
removed hard-coded PDF file name
Link to comment
Share on other sites

  • 3 months later...

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