Jump to content
-dp-

Create and send PDF without saving to disk?

Recommended Posts

-dp-

For each record in the found set, I need to create a mail-merge letter as PDF, and email the PDF. I can save the PDF to disk, then have the Send Mail function pick it up as an attachment, but then I would have to mop up the PDFs left on the disk. Is there a way to script the creation and sending of the PDF in a manner that doesn't leave anything on the disk? Thanks.

FMPA 18
macOS 10.14.6

Share this post


Link to post
Share on other sites
-dp-

Never mind. I found a solution that I had developed for another application, and was able to adapt it. For the benefit of someone else who has a similar need, the following script worked for me. Navigate to the layout from which you plan to generate the PDF, then...

Set Variable [ $_filename ; Value: <nameLastFirst> ]
Set Variable [ $_filepath; Value: Get (TemporaryPath ) & "/" & $_filename & ".pdf" ]
Save Records as PDF [ Restore ; With dialog: Off ; "$_filepath" ; Current record ; Create folders: Off ]
Send Mail [Send via E-mail Client ; With dialog: On ; Subject: "<whatever>" ; Message: "<whatever>" ; "$_filepath" ]
 

This opens an email with the PDF attached, but does not (apparently) leave any debris behind. This configuration is for a single record, but the hard part is done.

Share this post


Link to post
Share on other sites



  • WE NEED YOUR DONATION NOW

    WE have helped 100,000's of people for many years, now we need your help!!!! Your Donation is Needed to Keep Us Online! Covid 19 and isolation!!!! Without Your Help We Are Gone After 23  Years!



    3% of donation goal reached.
    Donate Sidebar by DevFuse
  • Images

×
×
  • Create New...

Important Information

Terms of Use