Jump to content

Page Count Rule


Recommended Posts

I have the following working just fine.


var r = Resource("File.pdf");

if (r.countPages > 2)
   FusionPro.Composition.SetBodyPageUsage("page3", true);


I was able to adapt this code for my project and it works great, thanks!!!


Just to explain my project, it's a booklet product in which a user uploads a PDF and overflow pages are automatically added. But I want to limit the user to a maximum of 48 pages. So working off that code, if a user uploads a PDF greater than 48 pages, it'll hide my Body and Overflow pages and activate my "Warning" page, which instructs the user to upload a PDF with no more than 48 pages.


dfalkowitz - Assuming your project similarly involves somebody uploading a PDF file, you should be able to setup a rule like this, replacing File Upload with your field:


var r = new FusionProResource(Field("File Upload"), "graphic", "true");

if (r.countPages > 1)
   return "Continued on next page";

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