#1
|
||||
|
||||
![]()
When composing chunked output files FP appends a number to the end of the filename. Is there a way to pad that number with zeros?
|
#2
|
||||
|
||||
![]()
Yes, if you create the OnNewOutput file rule, you can name the output file whatever you want by setting FusionPro.Composition.outputFileName. You can base it on a record number such as FusionPro.Composition.processedRecordNumber, or you can keep your own global counter variable. You can use FormatNumber to pad with zeros.
__________________
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, a while back you had given me this script to pad zeros in a batched output file where I could set the amount of padding...
Code:
if (Int(FusionPro.Composition.JobOptions["FinalPrint"])) { var oldEnding = FusionPro.Composition.currentOutputFileNumber + "." + FusionPro.Composition.outputFormatExtension var originalNameNoExt = FusionPro.Composition.outputFileName.replace(oldEnding, ""); FusionPro.Composition.outputFileName = originalNameNoExt + FormatNumber("000", FusionPro.Composition.currentOutputFileNumber) + "." + FusionPro.Composition.outputFormatExtension; } I would expect output names such as..."JobName_001.pdf", "JobName_002.pdf", "JobName_003.pdf", and so on. I've set it to 3 digits in the script so I expect a three digit number with leading zeros. However I am now getting "JobName_1001.pdf", "JobName_1002.pdf", "JobName_1003.pdf". FOUR digits and the first is always a "1". At first I thought it might be because the batched amount was going to be larger that the 3 digits will allow, but what I added a fourth zero to the script it just added another zero to the padded section and still put the 1 in front. Also if I put the extension ".pdf" in the output name section command line I'm giving to FP Server I get output names like "JobName_.pdf1001.pdf", "JobName_.pdf1002.pdf", "JobName_.pdf1003.pdf". What happened from FP8 to FP9? A new command for padding zeros in the output? .
__________________
David A. Sweet Variable Data Specialist HKM Direct Market Communications Windows 7, Acrobat 10.x FusionPro Desktop and Server 10.0.26 |
#4
|
||||
|
||||
![]()
David, that sounds like the issue that was being discussed here where there was a 1 being appended to the file name in earlier versions of FP9. However, Dan also says that problem was fixed in the 9.3.12 release so if you're running 9.3.15, I wouldn't think it's the same problem but it sounds too familiar not to bring up.
That being said, I guess you could try to remove all numbers preceeding the extension and replacing it with the formatted output file number (rather than just replacing the output file number and extension): Code:
FusionPro.Composition.outputFileName = FusionPro.Composition.outputFileName.replace(new RegExp('\\d*\\.' + FusionPro.Composition.outputFormatExtension + '$',''), function(){return FormatNumber("000", FusionPro.Composition.currentOutputFileNumber) + "." + FusionPro.Composition.outputFormatExtension;});
__________________
Ste Pennell FusionPro VDP Creator 9.3.15 Adobe Acrobat X 10.1.1 Mac OS X 10.12 |
#5
|
||||
|
||||
![]()
Thanks Step. If I use your expression would that only remove the number exactly prior to the extension such as just the 1 in the name "JobNumber_1.pdf"?
Would that expression also effect the number 12345 as is "12345-JobName_1.pdf", or again would it only effect the "1.pdf"? I sometimes have to put job numbers within the name of the output file prior to a "descriptive name" or "client name" in the output file.
__________________
David A. Sweet Variable Data Specialist HKM Direct Market Communications Windows 7, Acrobat 10.x FusionPro Desktop and Server 10.0.26 |
#6
|
||||
|
||||
![]()
The regular expression is starting at the end of the file and matching the extension, the period, and then as many numbers as it can find so in your example it would match (in red):
Quote:
__________________
Ste Pennell FusionPro VDP Creator 9.3.15 Adobe Acrobat X 10.1.1 Mac OS X 10.12 |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|