Jump to content

script for output file name


MikeCarenter

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 4 months later...

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...

Link to comment
Share on other sites

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];

Link to comment
Share on other sites

  • 5 years later...

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...