MikeCarenter Posted November 8, 2016 Share Posted November 8, 2016 i need help i use fusion pro to create a template for efi store front We have jobs coming through the store front and all is fine with one exception The files are all named the same this is a business card order page so we have 50 files with the same name isnt working for me so I need a script like new_file_name='BusinessCard_'+Field("Firstname")+'_'+Field("Lastname")+'.pdf'; FusionPro.Composition.outputFileName = new_file_name; return 0; but doesnt seem to work Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted November 9, 2016 Share Posted November 9, 2016 i need help i use fusion pro to create a template for efi store front We have jobs coming through the store front and all is fine with one exception The files are all named the same this is a business card order page so we have 50 files with the same name isnt working for me so I need a script like new_file_name='BusinessCard_'+Field("Firstname")+'_'+Field("Lastname")+'.pdf'; FusionPro.Composition.outputFileName = new_file_name; return 0; but doesnt seem to work First, where are you putting this code? Setting FusionPro.Composition.outputFileName only works in the OnNewOutputFile callback rule, and only if you are chunking the output to multiple output files. Also, does it work when you compose the job locally, in Acrobat? I'm pretty sure that web-to-print applications like DSF disallow renaming output files (and chunking). The reason they do this should be obvious: the web-to-print app needs to control the location of the output file, otherwise it won't know where it was generated and won't be able to locate it. Quote Link to comment Share on other sites More sharing options...
MikeCarenter Posted November 10, 2016 Author Share Posted November 10, 2016 then can you think of a way to have fusion pro name the pdf file using the first and last name?? Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted November 10, 2016 Share Posted November 10, 2016 then can you think of a way to have fusion pro name the pdf file using the first and last name?? Yes, by checking the "Output to multiple files" box on the Output tab of the Composition Settings dialog, and setting FusionPro.Composition.outputFileName in the OnNewOutputFile callback rule. I would be able to help you better if you could help me to help you by answering my questions. Again: First, where are you putting this code? And: Also, does it work when you compose the job locally, in Acrobat? Based on the answers to those questions, I might be able to suggest something more specific to help you. Quote Link to comment Share on other sites More sharing options...
-Lisa- Posted March 28, 2017 Share Posted March 28, 2017 Hi Dan, I'm trying to do something similar here by placing the FusionPro.Composition.outputFileName into an OnNewOutputFile callback rule. When I validate the rule, I receive the error: Type error: FusionPro.Composition.outputFileName is not a function This is what I'm placing inside the callback rule:return FusionPro.Composition.outputFileName(Field("LastName") +'_'+Field("FirstName"));I thought at first that something may be wrong with my syntax but that usually returns a syntax error... Quote Link to comment Share on other sites More sharing options...
step Posted March 28, 2017 Share Posted March 28, 2017 This is what I'm placing inside the callback rule:return FusionPro.Composition.outputFileName(Field("LastName") +'_'+Field("FirstName"));I thought at first that something may be wrong with my syntax but that usually returns a syntax error... There is something wrong with your syntax. It's that "FusionPro.Composition.outputFileName is not a function." Try writing it like this: FusionPro.Composition.outputFileName = Field("LastName") + '_' + Field("FirstName"); You'll probably also want to include an extension for the file name: FusionPro.Composition.outputFileName = Field("LastName") + '_' + Field("FirstName") [color="Red"]+ '.' + FusionPro.Composition.outputFormatExtension[/color]; Quote Link to comment Share on other sites More sharing options...
-Lisa- Posted March 28, 2017 Share Posted March 28, 2017 You are the best, Ste! Thank you again!! Quote Link to comment Share on other sites More sharing options...
ryanceot Posted April 5, 2022 Share Posted April 5, 2022 Is there a way to have Fusion Pro name the document with only the first letter of the first name? I've tried using FusionPro.Composition.outputFileName = Field("KEY1") + substr(Field("PFNAME"),1,1) + Field("PCIFID") + Field("PDDATE") + ".pdf"; but get a substr is not defined error. Quote Link to comment Share on other sites More sharing options...
ThomasLewis Posted April 6, 2022 Share Posted April 6, 2022 You just have the syntax messed up. Try Field("PFNAME").substr(0,1) Or better yet, use Field("PFNAME").charAt(0) Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted April 7, 2022 Share Posted April 7, 2022 You just have the syntax messed up. Try Field("PFNAME").substr(0,1) Or better yet, use Field("PFNAME").charAt(0) Or: Left(Field("PFNAME"), 1) Or just: Field("PFNAME")[0] Quote Link to comment Share on other sites More sharing options...
ryanceot Posted April 7, 2022 Share Posted April 7, 2022 Thomas and Dan, thank you for your help and quick responses! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.