3 Replies Latest reply on Mar 18, 2008 7:03 AM by (Tom_Warfield)

    Printing to a PDF - want to name the PDF File

      I am successfully printing a document to a PDF file. I am using the ,u argument in the Print Agent and I know this causes the pdf document to get a generic filename. How can I get the pdf filename to be a meaningful name such as the PO number? In other words, if I am printing Purchase order 12345, how can I get the pdf to be named 12345.pdf rather that the generic name of jf3897a.pdf

      Any suggestions would be greatly appreciated.

      I am running Jetforms 5.3

      Thanks,

      Tim Olig
      Information Tech Team Leader
      Mid-States Alumuinum Corp.
        • 1. Re: Printing to a PDF - want to name the PDF File
          Level 1
          You can reference the name that was used in a following step using the
          b @OutputFileName.
          variable. If you have no programming expertise to write a program to do a rename or file copy (or even if you do) then do the following...

          Create a task that runs the "program"
          b CMD
          and has the following program options:
          b /c c:\FolderName\FileName.bat
          . Replace "FileName" with any name you want, like "RenameFile". Replace "FolderName" with the name of the folder that you place the file into. The contents of the file, created with Notepad, would be the following:
          b ren FolderName.@OutputFileName. FolderName.YourDesiredName.pdf
          (all on one line). Replace "FolderName" with the name of the folder that the prior step had the PDF created into.

          Of course, using a data value as part of the file name would require it to be a parameter on the "job" line or provided by a custom agent that extracts it and stores it in a user variable such as
          b @user1.
          .
          • 2. Re: Printing to a PDF - want to name the PDF File
            Level 1
            Tom,

            Thanks for the quick reply. What I really want to do is name the pdf file after some data in the dat file. I have setup a global variable in my output program. How do I go about getting this to override the default name given by the system.

            Here is are some files that may help.

            The job statement being sent by the program.
            ^job MSADEBIT @DataFile @Outfile \\fdlweb1\c$\msa.tdf -asl2 -aii@IniFileName

            The Statement from the jfserver.jmd file that runs the JFMERGE.
            !f MSADEBIT JFDEBIT :\JetForm\Central\Server16EXTRANS\FORMS\msadebit.mdf * 1 T JFMERGE1 * * C *

            The actual JFMERGE statement
            !x JFMERGE1 * jfmerge "@MDFName @InFile -asl@SkipLines -z""@PhysicalDev."" -apfOff -rtrunc @PrintDirectorParms. @OtherJobTokens." "Permanently associated with the Print Director"

            The PRINTER Statement
            !p JFDEBIT * \\fdlweb1\elecdocs\popdf\timo,u.pdf * 50 *

            I am just not sure where to put the global variable to get the program to override the ,u argument.

            Any help would be appreciated.

            Thanks,

            Tim Olig
            Information Tech Team Leader
            Mid-States Aluminum Corp.
            • 3. Re: Printing to a PDF - want to name the PDF File
              Level 1
              I know of no way to do exactly what you are wanting without writing a custom agent (that is what we did to accomplish the same thing). The custom agent extracts the desired data value(s), building the name we want. It then causes Central to store it as a user variable via the
              b jetform.rsp
              file. See:
              i Returning Status and Parameters to Central
              in the Adobe Central Output Server - Working with Central manual. (It is probably named differently for your older version of Central - I'm using 5.6 .) The variable name is then used as the specified file name instead of using the
              b ,u
              parameter.

              Our output parameter looks like:
              b -z"c:\OutSource FTP\01-115\@user1.".pdf
              where
              i @user1.
              is the reference to the variable for the actual file name that the custom agent caused to be stored.

              If you are unable to create a custom agent but if the data source is also building the ^job line then you could have it use an unused option to pass the value to Central and then use a variable reference to it for passing on the file name. For example, we use the
              b -aji
              option (job ID) to pass on a data value to be used as the control file name for the Transformation Agent. It is referenced using the
              i @JobID.
              variable, like:
              b "C:\JetForm\Forms\Data Transformation\TDF Files\@JobID..tdf"