Go Back   MarcomCentral (PTI) and FusionPro User Communities > Support > Issues, Questions, Etc.

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 13th, 2022, 09:47 PM
brinehart brinehart is offline
Forum n00b
 
Join Date: Jul 2018
Posts: 4
Default Issue with Naming Output to Multiple Files

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);
Normally, this is used to output different files whenever a field changes values. I'm wanting to output files of 4000 records(2up stacks of 2000).

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:
  • "160555-1_A_impo1"
  • "160555-1_A_impo2"
  • "160555-1_A_impo3"
  • "160555-1_B_impo1"
  • "160555-1_B_impo2"

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.
  • "160555-1_A_impo"
  • "160555-1_impo2"
  • "160555-1_impo3"
  • "160555-1_B_impo"
  • "160555-1_impo5"

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
Reply With Quote
  #2  
Old October 14th, 2022, 03: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,694
Default Re: Issue with Naming Output to Multiple Files

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
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 16th, 2022, 08:13 PM
brinehart brinehart is offline
Forum n00b
 
Join Date: Jul 2018
Posts: 4
Default Re: Issue with Naming Output to Multiple Files

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:
Originally Posted by Dan Korn View Post
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().
Unless I'm missing something here, I think our issue if we turned off "Output to multiple files" is the amount of records for one chunk would be too much in a single file(60k+ records). And having the imposition file as cut and stack would get the records out of order when trimming sheets or splitting the files after composition.

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
Reply With Quote
  #4  
Old October 17th, 2022, 09:48 AM
sschardan sschardan is offline
Regular Contributor
 
Join Date: Oct 2008
Location: St. Louis, MO
Posts: 103
Default Re: Issue with Naming Output to Multiple Files

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;
            }
    }
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 04:36 PM.


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