We Use Cookies

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with this.

See our cookie policy.

Automation Action: Save As PDF

Save the incoming message, image or any HTML file or URL as a PDF document.

Built-In Action

Renders the incoming message, an image file or HTML file/URL as a PDF document.

From the Render list, select:

Render Incoming Message

To render in the incoming message. This will render the incoming message as it would appear in a web browser - including all images.

Render HTML File Or URL

To render any HTML file or web page. Enter the file path or full URL to the web page you want to save as a PDF.

Render Image File

To render an image file. Enter or select the file path of an image file or a (%variable% containing an image file). You can use PNG, JPEG, BMP, Webp, TIFF & GIF images. The image will be embedded inside HTML and the HTML will then be converted to a PDF. Enable the Centered option to center the image horizontally on the page. Enable the Border option to show the image within a rounded border.

Select the Page Size, Orientation & Margin.

You can also enter an open Password. Users opening the PDF must enter this password before they can view the content.

Enter the File Name and select the Save To folder. You can use %variable% replacements in the file name. A '.pdf' extension will be added if required.

If Ensure Unique File Name is enabled then ThinkAutomation will add a timestamp to the file name to ensure it is unique within the Save To folder.

If Delete File After Message Is Processed is enabled then ThinkAutomation will remove the file when the Automation completes for the current message. This is useful if you wish to use the document in the Automation (for example, to send the document as an attachment with the Send Email action, or to use the html file as the body of an outgoing email), but do not need to keep a local copy afterwards.

If Generate Table Of Contents Using H1-H6 Tags option is enabled then a table of contents will be generated using HTML heading tags (H1-H6) and inserted into the start of the document.

Enable the Print Created Document option if you want ThinkAutomation to print the PDF file after it is created. You can select the Printer to use.

You can assign the full save path & file name to a ThinkAutomation variable to use on subsequent actions (for example, if you wanted to attach the file to an outgoing message). Select from the Assign To list.

Header/Footer

You can also add Header & Footer text. The header/footer text can be plain text, HTML or Markdown. This will be rendered at the top & bottom of the page. You can also enter the Header/Footer Height in pixels. For the footer you can enable the Add Page Numbering option to add a centered Page x of y block below the footer text.

Page Breaks

The page breaks in the generated PDF document can be controlled using the following CSS properties:

  • page-break-before: always style forces a page break in the PDF before the element.
  • page-break-after: always style forces a page break after the element.
  • page-break-inside: avoid style will ensure a page break does not occur inside the element if possible.