4 Replies Latest reply on May 17, 2010 2:13 PM by ThomasShaw

    Save as PDF script

    ThomasShaw

      Title

      Save as PDF script

      Post

      I am looking to create a script step that takes the current record and saves it as a PDF.

       

      I want the name of the PDF to start with PO# followed by the actual PO# in the database.

       

      Example: PO#Y40036.pdf

       

      PO# would be static but the acutal purchase order number would be based off the current purchase order number record.

       

      Any suggestions?

       

      Thanks

        • 1. Re: Save as PDF script
          philmodjunk

          Here's how you would do this with your Desk Top as  the location to which you are saving your PDF:

           

          Set Variable [ $Path ;  "file:" & Get ( DesktopPath ) & "PO#" & YourTable::YourPOnumberField & ".PDF"]

          Save Records as PDF [Restore; No Dialog ; "$Path" ; Automatically Open ; Current Record ]

          • 2. Re: Save as PDF script
            ThomasShaw

            Thank you kind sir...

             

            Here's what I came up with:

             

            Go to Layout ["Purchase Order"]

            Set Variable [$fileName; Value:Get ( DesktopPath ) & "PO#" & ${DMX-MCT PO};;PUCHASE ORDER & ".pdf"}

            Save Records as PDF {Restore; No dialog; "$fileName"; Current record]

             

            Then I made a copy of that script and added the Send Email script step.  Now users can just have the PDF on the Desktop or have it on the Desktop as well as send the file.  The subject of the email messages was calculated to enter Purchase Order: (Purchase Order Number)

            • 3. Re: Save as PDF script
              philmodjunk

              You can also use Get ( TemporaryPath ) as a location. Then you don't have any after the fact cleanup chores to keep the desktop clutter under control.

              • 4. Re: Save as PDF script
                ThomasShaw

                Thank you,

                 

                I used your suggestion about the temporary path on the PDF to Email script I created..