2 Replies Latest reply on May 3, 2014 7:36 PM by keywords

    Can Filemaker dynamically name a PDF?


      After calling the Save as PDF function, a dialog box appears where the User is asked to name the PDF to be saved - and optionally assign a filepath for storage.

      Is there a way to have Filemaker dynamically set the name of this new PDF - say from the contents of a field or variable?


      Followup question - If this can be done and the filepath to the storage location has been scripted or otherwise assigned, in the solution I'm working on there would be no need I can see for the Save as PDF dialog box to appear.


      Is it possible to script in all choices the User would make in this box and then have Filemaker execute and bypass showing it?



      Mike Ainsworth

        • 1. Re: Can Filemaker dynamically name a PDF?

          Yes,  If you construct the whole path + file name in a variable, you can then specify that variable in the "save as" or "export" script step.


          Note that you can only specify a variable in that "specify" dialog, it is not a calculation window, you can not put a calculation there.

          • 2. Re: Can Filemaker dynamically name a PDF?

            Hi Mike. Here is a calc I use to set up a path to both save and retrieve. I use it in scripts, as suggested by wimdecorte, to save the pdf (using the $filepath variable) and also to insert the pdf itself into container field (using the $imagepath variable):


            Let( [


            mainpath = "/yourHD/(—the directory FMS uses, such as—Library/FileMaker Server/Data/Databases, or whatever you wish to use with FMP)/yourFolder/yourSubfolder(s)/" ;

            name = <calc here based on record being exported> & " quote " ;

            date = Month ( yourDatefield ) & "–" & Right ( Year ( yourDatefield ) ; 2 ) ;

            extension =  ".pdf" ;

            thedoc = mainpath & name & date & extension ;

            $filepath = "file:" & thedoc ;

            $imagepath = "image:" & thedoc ] ;


            $filepath & "¶" & $imagepath )