dfalkowitz Posted March 16, 2012 Posted March 16, 2012 Is there a way to create a rule based on the page count? For example: if pagecount > 1 return "Continued on next page" I know you can insert $pagecount into a text box but don't know how to add $pagecount into a rule. Thanks!
Stack Posted March 22, 2012 Posted March 22, 2012 BUMP! I'm trying to utilize $pagecount in a rule too, without luck...
dfalkowitz Posted March 22, 2012 Author Posted March 22, 2012 I was told by PTI, that you can not add it to rule, but this is something they are trying to develop it in a future release.
ThomasLewis Posted March 22, 2012 Posted March 22, 2012 I have the following working just fine. var r = Resource("File.pdf"); if (r.countPages > 2) { FusionPro.Composition.SetBodyPageUsage("page3", true); }
Stack Posted March 23, 2012 Posted March 23, 2012 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";
Recommended Posts
Archived
This topic is now archived and is closed to further replies.