Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library > Getting Started, Learning, Etc.

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 18th, 2015, 10:04 PM
methogod methogod is offline
Junior Community Member
 
Join Date: Jan 2010
Location: Baltimore, Maryland
Posts: 40
Default Need a rule to output "TEXT" on a imposed template every 50 records.

Running a non-variable page booklet. I need to place a barcode and some text every X number of pages. In this case its 50.

With the scanner turned on i can turn off double detect and some other features that slow down collating. If it doesn't see the mark on the 50th page it diverts the collation to the end of the line without finishing.

if this is a bad explaination lets make it simple. I am making pads in 50's, and i want to print "END_PAD" on the last page of every 50th page.

I have tired it with a if or statement but i think I need the function to start page count - since its every 50 imposed pages not 50 records
Reply With Quote
  #2  
Old April 20th, 2015, 09:29 AM
Dan Korn's Avatar
Dan Korn Dan Korn is online now
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,299
Default Re: Need a rule to output "TEXT" on a imposed template every 50 records.

It's hard to answer questions like this in the abstract, without seeing the job. But I assume that you mean you want want the barcode on the 50th imposed sheet, not on the imposed sheet containing the 50th page. So you probably want a rule something like this:
Code:
if (FusionPro.Composition.impositionSheetNumber % 50)
    return "";
//else
return "some text" + '<f name="IDAutomationC128L">' + TaggedTextFromRaw(Make128Barcode("some data"));
And you probably want to put that rule into a text box on the imposition sheet background.
__________________
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 April 20th, 2015, 11:41 AM
methogod methogod is offline
Junior Community Member
 
Join Date: Jan 2010
Location: Baltimore, Maryland
Posts: 40
Default Re: Need a rule to output "TEXT" on a imposed template every 50 records.

what you posted didnt work...
just need it to output a count 1 to X every 50 imposed pages.

and can i copy into a blank rule? or does it need to be a callback?
Reply With Quote
  #4  
Old April 20th, 2015, 12:42 PM
Dan Korn's Avatar
Dan Korn Dan Korn is online now
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,299
Default Re: Need a rule to output "TEXT" on a imposed template every 50 records.

Quote:
Originally Posted by methogod View Post
what you posted didnt work...
just need it to output a count 1 to X every 50 imposed pages.

and can i copy into a blank rule? or does it need to be a callback?
I can't offer any more specific suggestions without seeing the job files. Can you post the collected job? Also, I need to know, at the very least, the version of FusionPro you're running.
__________________
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 April 20th, 2015, 02:13 PM
methogod methogod is offline
Junior Community Member
 
Join Date: Jan 2010
Location: Baltimore, Maryland
Posts: 40
Default Re: Need a rule to output "TEXT" on a imposed template every 50 records.

Sorry...
latest version of FP 9.3.9
Acrobat X

attached is the job..

i got the code working on the impose, just not ever 50 imposed page.
I would like it to be on the 50th page, so the next page start a new pad.

If coding every 1st, 51, 101 etc is easier then that will work too...

Tried your way " % 50" and that didnt work, tried "==" to force to the right place and that works but not right.
Attached Files
File Type: zip TMC_Produce-PROOF-3.zip (400.8 KB, 4 views)
Reply With Quote
  #6  
Old April 20th, 2015, 05:04 PM
Dan Korn's Avatar
Dan Korn Dan Korn is online now
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,299
Default Re: Need a rule to output "TEXT" on a imposed template every 50 records.

I changed the first line of your "ENDOFPADS" rule to be exactly the same as the first line of the rule I suggested earlier, so that the rule now looks like this:
Code:
if (FusionPro.Composition.impositionSheetNumber % 50)
  return " ";
//else
return Rule("PADCOUNT");
Then I composed, and in the output PDF, output pages (imposed sheets) 50 and 100 had the corresponding numbers at the bottom, and other output pages (sheets) didn't. To me, that meets the stated requirement of "Need a rule to output TEXT on a imposed template every 50 records", although it's really every 50 sheets.

If that's not the desired result, then please explain exactly what result you do want, and specifically how it's different from the result I got. A mock-up of the desired output may be worth a thousand words.
__________________
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
  #7  
Old April 20th, 2015, 08:13 PM
methogod methogod is offline
Junior Community Member
 
Join Date: Jan 2010
Location: Baltimore, Maryland
Posts: 40
Default Re: Need a rule to output "TEXT" on a imposed template every 50 records.

Yes it works, but it outputs the imposition page count on the page instead of the counting each 50 =1

so on pg 50 should output 1
on pg 100 should output 2
so on pg 150 should output 3

Last edited by methogod; April 20th, 2015 at 08:20 PM..
Reply With Quote
  #8  
Old April 21st, 2015, 09:46 AM
Dan Korn's Avatar
Dan Korn Dan Korn is online now
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,299
Default Re: Need a rule to output "TEXT" on a imposed template every 50 records.

Quote:
Originally Posted by methogod View Post
Yes it works, but it outputs the imposition page count on the page instead of the counting each 50 =1

so on pg 50 should output 1
on pg 100 should output 2
so on pg 150 should output 3
Okay, I see. That's a much better description of the requirement than what was in your first post, and also better than your responses that what I posted "didn't work," even though my initial reply did do what was described, or at least what I interpreted from your initial description, which mentioned "a barcode and some text" and "END_PAD", which was actually completely different from what you're asking for now.

Anyway, just change the PADCOUNT rule to this:
Code:
return FusionPro.Composition.impositionSheetNumber / 50;
Or, putting the two rules together:
Code:
if (FusionPro.Composition.impositionSheetNumber % 50)
    return "";
//else
return FusionPro.Composition.impositionSheetNumber / 50;
Or, slightly more succinctly:
Code:
return (FusionPro.Composition.impositionSheetNumber % 50) ? "" : FusionPro.Composition.impositionSheetNumber / 50;
Or:
Code:
var num = FusionPro.Composition.impositionSheetNumber;
return (num % 50) ? "" : num / 50;
__________________
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)});

Last edited by Dan Korn; April 21st, 2015 at 09:48 AM..
Reply With Quote
Reply

Tags
imposition, javascript, templates

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 03:18 PM.


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