#1
|
|||
|
|||
![]()
Having an issue and wasn't sure if there was an elegant way to produce what I need or if even possible.
In OnRecordStart I have the code: Code:
if (FieldChanged("Version")) FusionPro.Composition.OpenNewOutputFile("160555-1_" + Field("Version") + "_impo + "." + FusionPro.Composition.outputFormatExtension); When not needing to split files by an amount of records I don't have any issues but trying to have multiple versions and outputting a specific amount of records breaks the naming. The file naming would ideally use the code and name the files:
Currently, I'm getting the first file named based on the code in OnRecordStart but every subsequent file is named based on what is input in "Output File:" in Composition Settings until the field changes to something different.
Is there a way to code the rule to output filenames based on data fields AND split files when a field changes?
__________________
FusionPro VDP Designer 12.1.3 Adobe Acrobat Pro 2022 macOS Monterey 12.6 |
#2
|
||||
|
||||
![]()
So there are two ways in which the output can be broken up, or "chunked," into multiple output files: static chunking and dynamic chunking.
Static chunking (the older way) is where each output file (except for possibly the first) has the same (static) number of records, defined on the Output tab of the Composition Settings. The names of the output files are based on the output file name specified in the Composition Settings, with numbers appended, unless a different name is specified in the OnNewOutputFile callback rule. Dynamic chunking (the newer way) is where each output file can have a different (dynamic) number of records. This is done, as you are doing, by calling FusionPro.Composition.OpenNewOutputFile() in OnRecordStart. In this case, the name of the new output file is also based on the output file name specified in the Composition Settings, with numbers appended, a different name is specified in the function call. It sounds like you're doing a hybrid, both kinds of chunking at the same time, which does work, but it can be weird. Sometimes a new output file is triggered by the record number, a multiple of the number specified in the Composition Settings, and somethings it's triggered by the field value changing per your OnRecordStart rule. I don't completely understand what you're trying to accomplish, but I think that you want to tun off the static chunking, by unchecking the "Output to multiple files" box in the Composition Settings, and just use dynamic chunking. Then all the output files you're making will have their names specified by the call to FusionPro.Composition.OpenNewOutputFile(). Or, you could continue to use a hybrid of static and dynamic chunking, and create the OnNewOutputFile rule to specify the names of the files being broken up by record numbers.
__________________
Dan Korn FusionPro Developer / JavaScript Guru / Forum Moderator PTI Marketing Technologies | Printable | MarcomCentral 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)}); ![]() |
#3
|
|||
|
|||
![]()
Dan, thank you for that info! I guess a little more background information would be helpful.
To help press loads and bindery/finishing, the sheet stacks were capped at 2000 sheets which is where the output to 4000 records(2up 2k records) was needed. To help the workflow of prepress, we have merged multiple processed lists into one master list—each group in the list is mailed out separately so they need to stay in separate files regardless of record count. That separation is where the OpenNewOutputFile helps keeps everything separate and named accordingly. I don't believe we've ever needed to have this type of chunking before—either the amount of records wasn't large enough to warrant chucking by record count or there was only one version to output. So, I wasn't sure if there was an easy way to accomplish this task Quote:
Was hoping there was another way of setting up my rules to use the dynamic chunking in a more efficient way that could use the same naming convention and keep files grouped together. Apologies if that explanation wasn't clear!
__________________
FusionPro VDP Designer 12.1.3 Adobe Acrobat Pro 2022 macOS Monterey 12.6 |
#4
|
|||
|
|||
![]()
Here is something I have done in the past. Maybe this will work for you:
Code:
Javascript Global var SetCount = 0 var SubSetCount = 1 If using imposition stacking OnJobStart FusionPro.Composition.chunksBreakStacks = true; OnRecordStart var JobNumber = "78807 " var StackSize = 4000 function NewName() { FusionPro.Composition.OpenNewOutputFile(JobNumber + Field("Package") + "_" + SubSetCount + "." + FusionPro.Composition.outputFormatExtension); } if (FieldChanged("Package")) { SetCount = 1; SubSetCount = 1; NewName() } else { if (SetCount < StackSize) { SetCount = SetCount + 1; } else { SubSetCount = SubSetCount + 1; NewName() SetCount = 1; } } |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|