2 Replies Latest reply on Sep 8, 2016 12:01 PM by TSPigeon

    Saving a record as a PDF and inserting it into a container field

    jareia

      Is there a way to save a record as a PDF and then insert it in a container filed?

      I've been able to add it to an email as an attachment but have been unsuccessful in adding the pdf document to a container field.

      I tried using a Set Field [container field] with the same Set Variable [ $PDFPath] but it didn't work. It only adds the path and name and not the document.

       

      I have attached the current script that works with the email. Can anyone give me an idea on what script steps to add to my current script so it also saves the document to an existing container field?

        • 1. Re: Saving a record as a PDF and inserting it into a container field
          gpupita@sestante.net

          I use this script to insert a pdf FILE into a container field

          Set Variable [ $file_id; the primary key ]

          Set Variable [ $file; Value:If (
          Abs ( Get ( SystemPlatform ) ) = 1 ; //Mac Get (TemporaryPath) & $file_id & ".pdf" ;

          "filewin:" & Get (TemporaryPath) & $file_id & ".pdf" )]

          Save Records as PDF [ File Name: “$file”; Records being browsed ]

          Go to Object [ Object Name: "give the container field a name" ]

          Insert File [ yourTable::FilePdf; “$file” ]

           

          If instead you want to insert the file as a PDF use

          Go to Object [ Object Name: "give the container field a name" ]

          Set Variable [ $file; Value:If (
          Abs ( Get ( SystemPlatform ) ) = 1 ; //Mac
          "imagemac:" & Get (TemporaryPath) & $file_id & ".pdf" ;

          "imagewin:" & Get (TemporaryPath) & $file_id & ".pdf" )]

          Insert PDF [ “$file” ]

          I have to double check the path on PCs, I'm on a Mac

           

          Ciao

          g. pupita

           

          • 2. Re: Saving a record as a PDF and inserting it into a container field
            TSPigeon

            jareia:

             

            Thank you for your post!

             

            gpupita@sestante.net gave great suggestions. I have also attached a sample file that gives a couple very basic methods for this.

             

            I am also going to move this thread from the FileMaker Community Feedback Space, which is specifically for input on the Community itself, to the Discussions Space where you should receive even more views and potentially more advice!

             

            TSPigeon

            FileMaker, Inc.