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 April 3rd, 2013, 12:06 PM
dreimer dreimer is offline
Senior Contributor
 
Join Date: Oct 2010
Location: Shakopee, MN
Posts: 469
Default Slipsheet on data change

So I am trying to set up a template where my unused slipsheet page will be inserted when the data changes in a field such as "Image". The number of records per "Image" will vary, but I will have the repeats built into the data file used so I don't need to use the RepeatRecord Function. I think it would neded to be an OnRecordStart rule, but not sure. Also, this will be one-up so no imposition file will be used. Is this possible with my current version of Fusion Pro? Any help would be great, TIA.
__________________
Don Reimer - JavaScript Novice

MAC OS 10.12.5 Acrobat XI 11.0.0 FP Creator 10.0.16
Windows 7 Acrobat X 10.1.4 FP Creator 9.3.9
Reply With Quote
  #2  
Old April 3rd, 2013, 12:35 PM
step's Avatar
step step is offline
Senior Contributor
 
Join Date: Jan 2010
Location: Charlotte, NC
Posts: 955
Default Re: Slipsheet on data change

You probably want to do something like this:

JavaScript Globals:
Code:
var img = "";
OnRecordStart:
Code:
if (img != Field("Image")){
     FusionPro.Composition.SetBodyPageUsage("Slipsheet",true);
     img = Field("Image");
}
__________________
Ste Pennell
FusionPro VDP Creator 9.3.15
Adobe Acrobat X 10.1.1
Mac OS X 10.12

LinkedIn
Reply With Quote
  #3  
Old April 3rd, 2013, 12:41 PM
dreimer dreimer is offline
Senior Contributor
 
Join Date: Oct 2010
Location: Shakopee, MN
Posts: 469
Default Re: Slipsheet on data change

Perfect, thank you Step. Love this forum!!!!!!!!!
__________________
Don Reimer - JavaScript Novice

MAC OS 10.12.5 Acrobat XI 11.0.0 FP Creator 10.0.16
Windows 7 Acrobat X 10.1.4 FP Creator 9.3.9
Reply With Quote
  #4  
Old April 3rd, 2013, 03:01 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,369
Default Re: Slipsheet on data change

Quote:
Originally Posted by step View Post
You probably want to do something like this:

JavaScript Globals:
Code:
var img = "";
OnRecordStart:
Code:
if (img != Field("Image")){
     FusionPro.Composition.SetBodyPageUsage("Slipsheet",true);
     img = Field("Image");
}
Actually, in FusionPro 8.0, it's even simpler, without requiring anything in the JavaScript Globals:
Code:
if (FieldChanged("Image"))
     FusionPro.Composition.SetBodyPageUsage("Slipsheet", true);
Or, even more succinctly:
Code:
FusionPro.Composition.SetBodyPageUsage("Slipsheet", FieldChanged("Image"));
Also, you can set the slip sheet arbitrarily like this even if you are using imposition, by setting the slip sheet to start at the beginning of a stack in the Composition Settings, and then starting a new stack like so in OnRecordStart:
Code:
if (FieldChanged("Image"))
     FusionPro.Composition.StartNewStack();
__________________
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 3rd, 2013, 03:25 PM
step's Avatar
step step is offline
Senior Contributor
 
Join Date: Jan 2010
Location: Charlotte, NC
Posts: 955
Default Re: Slipsheet on data change

Very true though his signature said he was running FP7.2
__________________
Ste Pennell
FusionPro VDP Creator 9.3.15
Adobe Acrobat X 10.1.1
Mac OS X 10.12

LinkedIn
Reply With Quote
  #6  
Old September 24th, 2013, 03:11 PM
marcuslayton marcuslayton is offline
Junior Community Member
 
Join Date: Sep 2008
Posts: 39
Default Re: Slipsheet on data change

can this:
Code:
if (FieldChanged("Image"))
     FusionPro.Composition.StartNewStack();
be used when using a repeat record count - something like this:
Code:
FusionPro.Composition.repeatRecordCount = Field("RunQty");
FusionPro.Composition.StartNewStack();
?
Reply With Quote
  #7  
Old September 24th, 2013, 05:33 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,369
Default Re: Slipsheet on data change

Quote:
Originally Posted by marcuslayton View Post
can this:
Code:
if (FieldChanged("Image"))
     FusionPro.Composition.StartNewStack();
be used when using a repeat record count - something like this:
Code:
FusionPro.Composition.repeatRecordCount = Field("RunQty");
FusionPro.Composition.StartNewStack();
?
Sure, but with that code, you'll get each output record in its own stack. You still need to tell it to start a new stack only when the input data changes. This should work:
Code:
FusionPro.Composition.repeatRecordCount = Field("RunQty");
if (FieldChanged("Image"))
    FusionPro.Composition.StartNewStack();
Or, since you're repeating, if you want each input record to go to its own stack, you could do this:
Code:
FusionPro.Composition.repeatRecordCount = Field("RunQty");
if (FusionPro.Composition.repeatRecordNumber == 1)
    FusionPro.Composition.StartNewStack();
__________________
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 January 15th, 2014, 03:22 PM
DCS DCS is offline
Junior Community Member
 
Join Date: Mar 2012
Posts: 13
Default Re: Slipsheet on data change

So how would I get a slip sheet before every file written using this code

if (FieldChanged("WelcomePackageCode"))
{
outpath = "c:\\Files\\Jan 14 Kits\\Mailing\\FS Labels\\" + Field("WelcomePackageCode") + "\\";
filename = Field("WelcomePackageCode");
outfile = outpath + filename;

FusionPro.Composition.OpenNewOutputFile(outfile + "." + FusionPro.Composition.outputFormatExtension);

}

Also, Can I get the slipsheet to impose like the rest of the file

thanks
Mike
Reply With Quote
  #9  
Old January 15th, 2014, 04:23 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,369
Default Re: Slipsheet on data change

Quote:
Originally Posted by DCS View Post
So how would I get a slip sheet before every file written using this code

if (FieldChanged("WelcomePackageCode"))
{
outpath = "c:\\Files\\Jan 14 Kits\\Mailing\\FS Labels\\" + Field("WelcomePackageCode") + "\\";
filename = Field("WelcomePackageCode");
outfile = outpath + filename;

FusionPro.Composition.OpenNewOutputFile(outfile + "." + FusionPro.Composition.outputFormatExtension);

}
This is pretty much what we've been talking about in the rest of this thread. Just add a call to FusionPro.Composition.StartNewStack() in there, and in the Composition Settings, under Imposition, make sure you have the slip sheet set to be output at the beginning of a stack.
Quote:
Originally Posted by DCS View Post
Also, Can I get the slipsheet to impose like the rest of the file
I don't understand the question. If the sheet is imposed with the rest of the output pages, then it's not really a slip sheet, by definition. If that's what you want to do, then forget about slip sheets, and just call out an Unused Body Page, like so:
Code:
FusionPro.Composition.SetBodyPageUsage("slipsheet", FieldChanged("WelcomePackageCode"));
Which was basically what I said in my first post in this thread.
__________________
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
  #10  
Old January 15th, 2014, 08:19 PM
DCS DCS is offline
Junior Community Member
 
Join Date: Mar 2012
Posts: 13
Default Re: Slipsheet on data change

I had already tried adding the
FusionPro.Composition.StartNewStack()

didin't work...

Is there a place I should put it (within the brackets, outside)?

I will try your 2nd suggestion... where should I put that?

Thanks
Mike
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 03:34 PM.


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