7 Replies Latest reply on Aug 28, 2014 7:32 PM by JasonHolladay

    Combine an existing PDF in container field with a record saved as PDF

    Alan_P

      Title

      Combine an existing PDF in container field with a record saved as PDF

      Post

      Hello all,

      We need to combine an existing PDF document with that of an employee record and send it via email.

      I have everything set where we can email the record, etc., however the existing PDF document that needs to also be mailed out is the problem.

      Created a container field with global property and inserted the existing PDF document in there.  Where I'm stuck is how to 'combine' or 'append' that existing PDF in the container field with that of a record saved as a pdf...all in one PDF.

      Is this possible?  Variables?  Not really sure how to do this.  I'd like to stay away from any third party programs, if possible. 

      Thank you in advance!

        • 1. Re: Combine an existing PDF in container field with a record saved as PDF
          philmodjunk

          If you use Export Field contents to export the PDF from the container field to a location on your workstation hard drive, you can then use the append option to merge the old PDF with the new.

          • 2. Re: Combine an existing PDF in container field with a record saved as PDF
            Alan_P

            Thank you PhilModJunk!

            Could I ask you for a little more help?  I'm following what you are saying, but not sure how to go about doing that.  I can't attach a screenshot of the script steps I have so far, but esentially it goes like this:

            1) Set Variable ($RecertNotice)
            Name:  $RecertNotice
            Value: Let ( [
                    MAC = "filemac:" & Get ( TemporaryPath ) ;
                    PC = "filewin:" & Get ( TemporaryPath )
            ] ;
            Case(Abs(Get ( SystemPlatform )) = 1; MAC; Abs(Get ( SystemPlatform ))= 2 ;
            PC ) & "Testing Notice.pdf")
            Repetition: 1
            2) Save Records as PDF (goes to a particular layout where a 'letter' is that is saved as pdf as $RecertNotice)
            3) **** Here is the part where I want to add the external PDF file to be part of $RecertNotice, but not sure how (e.g. container field?  I can have it on a network drive if that helps, does not need to be in FMP) ***
            4) Send Mail (with $RecertNotice as the attachment)

            • 3. Re: Combine an existing PDF in container field with a record saved as PDF
              philmodjunk

              You can upload screen shots to your original post (click the edit post link). Or you can upload the screen shot to a file share site and post the download link in any of your posts. You can also copy and paste the script text either from a PDF of your script or from a database design report (FileMaker advanced only.)

              To simplify things, instead of mac and windows versions of a filepath, you can just use: "File:" & Get (TemporaryPath) & "Testing Notice.pdf"

              Save both PDF's to $RcertNotice, but specify the Append option for the second such save and it should append the 2nd PDF to the first.

              Then step 4 should work as you describe.

              • 4. Re: Combine an existing PDF in container field with a record saved as PDF
                Alan_P

                Oh ok thank you!  I must have missed the icon for that.

                For your answer...

                "Save both PDF's to $RcertNotice, but specify the Append option for the second such save and it should append the 2nd PDF to the first."

                ...would I be using "Save Records as PDF" script step for the global container field that contains the PDF file? 

                Guess I'm just a little stuck on how to actually append/save a pure .pdf file along with a record that is saved as a pdf (hope that makes sense!  I'm beginning to confuse myself :))

                If you need me to upload a screenshot, I'll do that.  Thank you!!

                • 5. Re: Combine an existing PDF in container field with a record saved as PDF
                  philmodjunk

                  I confused your post with a similar one that was also discussing appending PDF's.

                  Obviously, you have a pdf already created and either stored in a container field or you have a reference to the file already stored. Let's call that PDF, PDF #1.

                  Use export Field contents to export the contents of the container field storing PDF #1 to the $RecertNotice location. Then use Save as PDF to save the new PDF to this same $RecertNotice location, but with the append option selected.

                  The result should be PDF #1 with PDF #2 appended to it.

                  • 6. Re: Combine an existing PDF in container field with a record saved as PDF
                    Alan_P

                    PhilModJunk...that worked!!! You are amazing :)  Thank you again!!

                    • 7. Re: Combine an existing PDF in container field with a record saved as PDF
                      JasonHolladay

                           I need to do this same thing but in revers. I need to create a pdf and then append an existing pdf contained in a container field and then email the whole thing.  I'm new to filemaker, so I'll need a little more explanation than above.

                            

                           Thanks.