Jump to content

1 pdf, many pages


eliggins

Recommended Posts

Hi, I'm needing to building a versioned product that will need to detect how many pages of a pdf are being uploaded to it. The idea is, in the portal I would have a field that the client would input the number of pages, for instance 1-8, they would then upload one pdf that would be 1 page or 8 pages, and the template would create the additional pages as needed. My question is, is this possible, and how? I can't use job direct as it doesn't allow impositons:confused:
Link to comment
Share on other sites

You can determine how many pages are in a PDF by using the 'countPages' method of a FusionProResource. For example:

var pdf = CreateResource(Field("Uploaded PDF Location"));
return pdf.countPages; 

Aside from that, though, I'm not sure how to answer the rest of your question. How are you going to "build additional pages as needed?" Are you just trying to output the first page of the uploaded PDF X times? In other words: if they upload a 2 page PDF and input "8" pages, you'd duplicate the first page 6 more times so that you'd end up with an 8 page PDF? If that's the case, it doesn't really matter how many pages are in the PDF they upload, you could just set the record to repeat as many times as the client input – each time returning the first page of their uploaded PDF:

 

OnRecordStart

FusionPro.Composition.repeatRecordNumber = Field("Number of pages");
FindGraphicFrame("Your graphic frame").content(CreateResource(Field("Uploaded PDF Location"), 'graphic'));

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.

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