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 September 30th, 2011, 09:22 AM
rsager rsager is offline
Junior Community Member
 
Join Date: Mar 2011
Location: Valley Forge, PA
Posts: 15
Default Javascript Rule to suppress pages at preview

We have a calendar that we would like the customer to preview the first 14 pages and have the last 14 pages, pages 15-28 to be use as the printer pages. Is there a Javascript rule that will let us do this?
Attached Files
File Type: pdf calendar2012_Lg.pdf (3.45 MB, 10 views)
Reply With Quote
  #2  
Old September 30th, 2011, 10:02 AM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,671
Default Re: Javascript Rule to suppress pages at preview

I'm not sure what you mean by "preview" in this context. In FP Desktop, all body pages are previewed. If you mean that you only want to compose a subset of pages, that's done by naming pages and calling the FusionPro.Composition.SetBodyPageUsage function in OnRecordStart. Search this forum or the Rules Guide for SetBodyPageUsage for more information.

Also, instead of painstakingly lining up 30 or so frames on multiple pages, you could write a JavaScript rule to dynamically generate tables for the calendar months, with logic such as this. You could reuse the logic and compose the job for different years without having to redo the whole thing each year.
__________________
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 September 30th, 2011, 01:02 PM
rsager rsager is offline
Junior Community Member
 
Join Date: Mar 2011
Location: Valley Forge, PA
Posts: 15
Default Re: Javascript Rule to suppress pages at preview

We are trying to create an 11 X 17 two sided saddle stitch calendar. There does not seem to be an easy way to do this in FrusionPro. We would like the first 14 pages to be previewed in MarcomCentral the way the end user will see it. The last 14 pages are the printer spreads. Preview Body 1-14, Compose Body 15-28.
There may be an easier way to do this the end result should be pages 15-28.

The calendar needs to print with the January's photo on top of the bottom half of page 14. January's calendar would print with the top half of page 14. February's photo would print with December's calendar. February's calendar would print with December's photo. March's photo would print with November's calendar. March's calendar would print with November's photo. April's photo would print with October's calendar. April's calendar would print with October photo. May's photo would print with September's calendar. May's calendar would print with September's photo. June's photo would print with August's calendar. June's calendar would print with August's photo. July's photo would print with July's calendar as it appears.

I hope this makes sense.
Thanks for your help.
Reply With Quote
  #4  
Old September 30th, 2011, 02:02 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,671
Default Re: Javascript Rule to suppress pages at preview

Quote:
Originally Posted by rsager View Post
in MarcomCentral
Ah, this was the context that was missing. Please ask questions specific to MarcomCentral in the MarcomCentral forum.

That said, to do saddle stitch output in FusionPro, you don't need to have two whole different sets of pages, one with the "regular" layout and one with the saddle-stitch order. You just need to use FusionPro's built-in imposition capabilities. There's a "Saddled Stitched" option on the Layout tab in FP Imposer which does this. Then you can just check or uncheck the first box on the Imposition tab of the Composition Settings dialog to switch between the two modes. In fact, I believe that MarcomCentral does this automatically, and shows the un-imposed pages (the "end user" view) for preview, but composes using imposition (i.e. the "printer spreads") for press output. But that can be clarified on the MCC forum.
__________________
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 3rd, 2011, 11:35 AM
rsager rsager is offline
Junior Community Member
 
Join Date: Mar 2011
Location: Valley Forge, PA
Posts: 15
Default Re: Javascript Rule to suppress pages at preview

Dan,
Thanks for replying to my post.
The way the output pages need to be arranged we can not set this up using a simple Tumble Duplex or Saddle stitch option in FusionPro Imposer. I was told by support that it could be done as a OnRecordStart Callback rule, very much like hiding pages with the word “Proof” on them. I am trying to do this on my own without any success.
Attached Files
File Type: zip Calendar2012.zip (7.71 MB, 10 views)

Last edited by rsager; October 4th, 2011 at 06:32 AM.. Reason: add zip file
Reply With Quote
  #6  
Old October 3rd, 2011, 12:01 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,671
Default Re: Javascript Rule to suppress pages at preview

Quote:
Originally Posted by rsager View Post
The way the output pages need to be arranged we can not set this up using a simple Tumble Duplex or Saddle stitch option in FusionPro Imposer.
Why not? What exactly do you need to do that FP Imposer can't handle? Did you try using FP Imposer? Did you try right-clicking on the pictures of the pages in the upper right pane and selecting one of the "Rotate" options?
Quote:
Originally Posted by rsager View Post
I was told by support that it could be done as a OnRecordStart Callback rule, very much like hiding pages with the word “Proof” on them. I am trying to do this on my own without any success.
Yes, as I said before, you need first need to name all your pages in the Page Usage dialog, then conditionally call the FusionPro.Composition.SetBodyPageUsage function for each page in OnRecordStart. But, as I also said before, exactly how to determine whether MarcomCentral is doing an online preview, in your rule, is something you need to ask about in the MarcomCentral forum.
__________________
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 October 3rd, 2011, 03:38 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,671
Default Re: Javascript Rule to suppress pages at preview

Quote:
Originally Posted by Dan Korn View Post
Yes, as I said before, you need first need to name all your pages in the Page Usage dialog, then conditionally call the FusionPro.Composition.SetBodyPageUsage function for each page in OnRecordStart. But, as I also said before, exactly how to determine whether MarcomCentral is doing an online preview, in your rule, is something you need to ask about in the MarcomCentral forum.
It turns out that the thing to switch off of in a MarcomCentral composition is the IsOnlinePreview() function. Therefore your OnRecordStart rule could look something like this:
Code:
for (var pageNum = 1; pageNum <= 14; PageNum++)
  FusionPro.Composition.SetBodyPageUsage("Preview " + PageNum, IsOnlinePreview());
for (var pageNum = 1; pageNum <= 14; PageNum++)
  FusionPro.Composition.SetBodyPageUsage("Press " + PageNum, !IsOnlinePreview());
Where you've gone into the Page Usage dialog and named all of your pages "Preview 1", "Preview 2", etc., and "Press 1", "Press 2", etc.

Although I still don't see why this can't all be done with FP Imposer.
__________________
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
  #8  
Old October 4th, 2011, 06:26 AM
rsager rsager is offline
Junior Community Member
 
Join Date: Mar 2011
Location: Valley Forge, PA
Posts: 15
Default Re: Javascript Rule to suppress pages at preview

I wil try this. I attached the PDF that is produced by MarcomCentral. When we print the file out duplexed tumble January's photo is in the correct but it is matched up with February's Calendar. January's calendar ends up on the last page. The next page we end up with March's Photo matched with April's calendar and so on. Thanks for taking the time to help me out with this.
Reply With Quote
  #9  
Old October 1st, 2015, 10:15 AM
sgillesp sgillesp is offline
Forum n00b
 
Join Date: Nov 2014
Posts: 3
Default Re: Javascript Rule to suppress pages at preview

In this situation, I would love to see an option built into MarcomCentral, template area, viewer options to allow the preview image to be rotated. This would be helpful, as the admin who isn't building the template or designing the product, but just wants our end user to be able to read the preview and approve it before ordering it.

Last edited by sgillesp; October 1st, 2015 at 10:16 AM.. Reason: typo
Reply With Quote
  #10  
Old October 1st, 2015, 10:37 AM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,671
Default Re: Javascript Rule to suppress pages at preview

Quote:
Originally Posted by sgillesp View Post
In this situation, I would love to see an option built into MarcomCentral, template area, viewer options to allow the preview image to be rotated. This would be helpful, as the admin who isn't building the template or designing the product, but just wants our end user to be able to read the preview and approve it before ordering it.
Bug reports and enhancement suggestions for the MarcomCentral product should be directed to your BRM, or at least posted in the MarcomCentral app forum.

That said, there's no reason why you can't switch off of the IsOnlinePreview() function in OnRecordStart to conditionally call out different pages. You can even use the GetBodyPage and FindTextFrame and FindGraphicFrame functions to resize and move pages and frames in the online composition.

And again, you can use imposition to have the final "press" composition laid out differently than the preview.
__________________
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
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 11:37 PM.


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