Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > FusionPro® VDP Creator

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 27th, 2008, 08:55 AM
havdp havdp is offline
Junior Community Member
 
Join Date: Sep 2008
Location: Winston-Salem, NC
Posts: 32
Unhappy Access page number within a rule

Is there a way to access the current page number within a rule. I've found "FusionProResource.pagenumber" but can't find any documentation on how to use it. It appears to be used with external resources, though. I need to access the current page number in the control document.
Reply With Quote
  #2  
Old October 27th, 2008, 01:52 PM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,638
Default Re: Access page number within a rule

Quote:
Originally Posted by havdp View Post
Is there a way to access the current page number within a rule.
No. With the exception of a few specialized Callback rules, rules are evaluated on a per-record basis, not on a per-page or per-frame basis. So there really isn't a way to access the page number from a rule.

That said, if I knew what you were trying to accomplish, I might be able to suggest another approach.
Quote:
Originally Posted by havdp View Post
I've found "FusionProResource.pagenumber" but can't find any documentation on how to use it. It appears to be used with external resources, though.
Right. That's for specifying a page number from a multi-page graphic resource (such as a PDF) to use in a graphic copyhole. It's not relevant to the composed output page number.
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
  #3  
Old October 27th, 2008, 02:13 PM
havdp havdp is offline
Junior Community Member
 
Join Date: Sep 2008
Location: Winston-Salem, NC
Posts: 32
Default Re: Access page number within a rule

I was attempting to write a rule that would calculate data for a barcode that drives our stitcher. Outside the trim on the last page of each sheet we print a barcode that tells the stitcher which sheet it is out of the total number of sheets.

For example, on a 12-page saddle stitch booklet, we would print a barcode outside the trim on pages 8, 10, and 12 which tells the stitcher they are sheets 1 of 3, 2 of 3, and 3 of 3, respectively. If I could access the page number, I could write a rule such as:

var pages = 12;
return ((pagenumber-(pages/2))/2) + ' of ' + (pages/4);

on page 8:
(8-(12/2))/2 = (8-6)/2 = 2/2 = "1 of " (12/4) = "3"

This would prevent me accidentally typing in the wrong data within the barcode which I can't read without a scanner.
Reply With Quote
  #4  
Old October 27th, 2008, 02:32 PM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,638
Default Re: Access page number within a rule

Quote:
Originally Posted by havdp View Post
I was attempting to write a rule that would calculate data for a barcode that drives our stitcher. Outside the trim on the last page of each sheet we print a barcode that tells the stitcher which sheet it is out of the total number of sheets.

For example, on a 12-page saddle stitch booklet, we would print a barcode outside the trim on pages 8, 10, and 12 which tells the stitcher they are sheets 1 of 3, 2 of 3, and 3 of 3, respectively.
I see. Well, you'll need three separate text frames on different pages to accomplish this anyway, so I'm not sure having one rule saves you that much.
Quote:
Originally Posted by havdp View Post
If I could access the page number, I could write a rule such as:

var pages = 12;
return ((pagenumber-(pages/2))/2) + ' of ' + (pages/4);

on page 8:
(8-(12/2))/2 = (8-6)/2 = 2/2 = "1 of " (12/4) = "3"

This would prevent me accidentally typing in the wrong data within the barcode which I can't read without a scanner.
I'm not sure what you mean about typing in the wrong data. You should be able to hard-code the "1 of 3" or whatever on each page. If the issue is that you're trying to type that text in a barcode font, just create a rule to output an <f name=***> tag for the barcode font, and insert that before your text in the frame, and then you can type in a readable font.
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
  #5  
Old October 28th, 2008, 07:51 AM
havdp havdp is offline
Junior Community Member
 
Join Date: Sep 2008
Location: Winston-Salem, NC
Posts: 32
Default Re: Access page number within a rule

I hadn't thought about using a font tag. That's a good idea.

If all my booklets were only 12 pages, hard coding wouldn't be such an issue. What I do now is copy and paste the text box on each page, then change the font to a human readable font, edit the text, and change the font back to the barcode font. That's a lot of work on an 80-page booklet. If I had a rule, I could just copy and paste without editing.
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 06:55 PM.


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