Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 16th, 2012, 04:55 AM
dfalkowitz dfalkowitz is offline
Junior Community Member
 
Join Date: Mar 2009
Posts: 35
Default Page Count Rule

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!
Reply With Quote
  #2  
Old March 22nd, 2012, 10:37 AM
Stack's Avatar
Stack Stack is offline
Regular Contributor
 
Join Date: Oct 2008
Location: Annapolis Junction, MD, USA
Posts: 105
Default Re: Page Count Rule

BUMP!

I'm trying to utilize $pagecount in a rule too, without luck...
Reply With Quote
  #3  
Old March 22nd, 2012, 10:46 AM
dfalkowitz dfalkowitz is offline
Junior Community Member
 
Join Date: Mar 2009
Posts: 35
Default Re: Page Count Rule

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.
Reply With Quote
  #4  
Old March 22nd, 2012, 03:41 PM
ThomasLewis's Avatar
ThomasLewis ThomasLewis is offline
Senior Contributor
 
Join Date: Feb 2011
Posts: 206
Default Re: Page Count Rule

I have the following working just fine.

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

if (r.countPages > 2)
{
    FusionPro.Composition.SetBodyPageUsage("page3", true);
}
Reply With Quote
  #5  
Old March 23rd, 2012, 09:48 AM
Stack's Avatar
Stack Stack is offline
Regular Contributor
 
Join Date: Oct 2008
Location: Annapolis Junction, MD, USA
Posts: 105
Default Re: Page Count Rule

Quote:
Originally Posted by ThomasLewis View Post
I have the following working just fine.

Code:
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:

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

if (r.countPages > 1)
    return "Continued on next page";
Reply With Quote
  #6  
Old March 24th, 2012, 06:58 AM
dfalkowitz dfalkowitz is offline
Junior Community Member
 
Join Date: Mar 2009
Posts: 35
Default Re: Page Count Rule

Thanks for the input!!!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:49 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.