eliggins Posted November 29, 2016 Share Posted November 29, 2016 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: Quote Link to comment Share on other sites More sharing options...
step Posted November 30, 2016 Share Posted November 30, 2016 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')); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.