Skip to content

Document Automation Actions

ThinkAutomation includes a comprehensive set of document automation actions that allow your Automations to generate, convert, extract, merge, sign, print, and process documents in a wide range of formats. These actions can create documents and spreadsheets from templates containing %variables%, convert between document types, extract text or data for further processing, append or sign PDF files, and produce printable reports. They are commonly used for automated document generation (such as quotations, invoices, certificates, or reports), attachment preparation for outgoing messages, OCR data extraction, and workflow-driven document processing. All document actions support variable replacement so that generated output can be dynamically personalized for each message.

Create Document

The Create Document automation action can be used to create a custom document using the built-in Word Processor and save the document in various formats. The custom document can include automation %variables%. The saved document can then be used further in your automation workflow (for example: To include as an attachment with an outgoing email).

The Document Editor emulates Microsoft Word. You can format the document as you would with Word using fonts, tables, headers/footers etc. You can load an existing document file using the File - Open option. Once you save the Action the document data will be saved with your Automation (the original file will remain unchanged).

Inserting Variables

Variables can be dragged and dropped onto the document (or type the %variablename% directly in the document). These will be replaced when the Automation executes. Any formatting applied to the %variable% will be preserved when the value is replaced.

Save As

From the Save As Format list select the type of file to save when the Automation Executes. The document can be saved as:

  • PDF
  • DOCX (Microsoft Word)
  • ODT (Open Document)
  • TXT (Text File)
  • RTF (Rich Text File)
  • HTML
  • MHT
  • EPub

When the Automation executes, the document template will be used to create a file in the above format. All %variables% in the document will be replaced.

If PDF format is selected then you can specify a Password. The recipient of the PDF file will need the password to open it.

If HTML format is selected then the following options are available:

  • Use Inline Styles - select this option to use Inline CSS instead of a style section. This option should be used if you will use the HTML on outgoing emails.
  • Embed Images - select this option to specify whether images should be embedded into the HTML or stored externally. Embedded images in the HTML document are stored in base64 encoding. This option should be used if you will use the HTML on outgoing emails.

Specify the Save To folder - click the ... button to select a local file or use %Root% to save it in the default ThinkAutomation location.

Enter a File Name to save the document as (the extension will be added automatically based on the Save As Format if it is not specified).

If Ensure Unique File Name is enabled then ThinkAutomation will add a timestamp to the filename to ensure it is unique.

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.

You can assign the saved path & filename to a variable by selecting the variable from the Assign Path To list. You can then use this variable in the Attachments entry on Send Email actions or in any other way.

Enter the Document Name. This shows in the actions list and Automation log. If a File Name is not specified then the document name will be used. For PDF exports the PDF document properties 'title' will be set to the document name.

Default Document Template

When creating a new document, ThinkAutomation will look for the Microsoft Word document DefaultDocument.docx in the ThinkAutomation program files folder. If this file exists it will be loaded and all the styles available in the document can then be used in the new document.


Create Spreadsheet

The Create Spreadsheet automation action can be used to create a custom Excel compatible spreadsheet and save the spreadsheet in various formats. The custom spreadsheet can include automation %variables%. The saved spreadsheet can then be used further in your automation workflow (for example: To include as an attachment with an outgoing email).

Automation %variables% can be assigned to cells when the Automation executes. Spreadsheet formulas are then recalculated. The resulting spreadsheet can then be saved in various formats and you can read cell values back into Automation %variables%. You can use this Action to create formatted Invoices, Quotations etc. that can then be saved and emailed.

The Spreadsheet Editor emulates Microsoft Excel. You can format the spreadsheet as you would with Excel using formulas, charts, images, borders, fonts etc. You can load an existing Excel file using the File - Open option. Once you save the Action the spreadsheet data will be saved with your Automation (the original file will remain unchanged).

Inserting Variables

Spreadsheet cells can contain Automation %variables%. When the Automation executes these will be replaced with their values.

There are two ways to embed %variables%.

  1. Drag and drop a variable from the Variables List onto any cell or edit a cell and include one or more %variables% inside any text. It is assumed these variables are not used in formulas.

  2. Add a Cell Assignment. You would use this method if the cell is used in a formula. Select a cell in the Spreadsheet and click the Add button from the Before Calculation Assign Variables To Cells list. The Assign Cell form will be displayed. Enter a value or select a %variable% from the Assign From list. You can enter a value in the spreadsheet cell itself as a placeholder to allow you to see formatting/formula results etc. When the Automation executes the cell value will be replaced and all formulas re-calculated. You can create any number of Cell Assignments.

Saving The Spreadsheet (optional)

Enable the Export File option.

From the Save As Format list select the type of file to save when the Automation Executes. The spreadsheet can be saved as:

  • Excel File
  • CSV File
  • PDF Document
  • HTML File

When the Automation executes, the spreadsheet template will be used to create a file in the above format. All %variables% and Cell Assignments in the spreadsheet will be replaced and formulas re-calculated.

If Excel or PDF format is selected then you can optionally specify a Password. The recipient of the file will need the password to open it.

Specify the Save To folder - click the ... button to select a local file or use %Root% to save it in the default ThinkAutomation location.

Enter a File Name to save the spreadsheet as (the extension will be added automatically based on the Save As Format).

If Ensure Unique File Name is enabled then ThinkAutomation will add a timestamp to the filename 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 spreadsheet as an attachment with the Send Email action), but do not need to keep a local copy afterwards.

You can assign the saved path & filename to a variable by selecting the variable from the Assign Saved File Path To list. You can then use this variable in the Attachments entry on Send Email actions or in any other way.

Reading Back Cell Values

After all Cell Assignments have been made and formulas re-calculated you can optionally read cell values back and assign to Automation %variables%.

For example, you could create a quotation spreadsheet that adds %qty% and %price% variables and then read back the 'total' cell to a %variable% which you can then use further in the Automation.

Select a cell in the Spreadsheet and click the Add button from the After Calculation Assign Cells To Variables list. The Assign Cell form will be displayed. Select a %variable% from the Assign To list. You can create any number of Variable Assignments.

Assign CSV Data

You can optionally assign the spreadsheet data in CSV format to a variable. Select the variable from the Assign CSV Data To list. Enable the Use Formatted Values For CSV if you want to return data as it has been formatted, otherwise unformatted data is used.

This option is useful if you want to use the Spreadsheet action to simply create a table of data that you can then use further in the Automation. For example, you may want to include a table in an outgoing email. Use the Spreadsheet action to create your table and assign the CSV data to a variable. Then use the Set Variable action with the Convert CSV To Markdown Table operation and include the Markdown table in your outgoing email body.


Convert Document

The Convert Document automation action can be used to convert a Microsoft Word, Microsoft Excel, PDF, Open Document, Richtext, Text, Markdown Text, CSV or HTML, file to various formats. The converted document can then be used further in your automation workflow.

The document to convert can be a local file (or a file saved from a previous action) or incoming Attachments.

Select a Document To Convert - this can be any local file or a %variable% replacement. You can specify multiple documents if required, separated by commas (any file paths that contain commas must be enclosed in quotes).

Enable the Include Incoming Attachments option to convert attached documents matching the Matching Mask. Enter *.* to convert all supported attachments.

Select the Convert To type. You can convert to the following formats:

  • PDF
  • DOCX (Microsoft Word)
  • ODT (Open Document)
  • XLSX (Microsoft Excel)
  • XPS
  • HTML
  • TXT
  • CSV
  • Images (PNG, GIF, BMP, JPEG, TIFF)

When converting PDF to image files, each page in the PDF document will be converted to a separate image file. The page number will be added to the filename, eg: document_1.tiff, document_2.tiff.

When converting to Excel, the document to convert can be CSV, XLS or text only.

In the Rename Converted Files To entry you can optionally specify a new name for the converted file. You can use %fieldname% replacements - for example: order%OrderNumber%.pdf would rename the attachment order1234.pdf if the %OrderNumber% field contained '1234'.

You can use the special variable replacement %filename% to use the original file name as part of the renamed file. For example, suppose the document to convert was called "orderdata.docx" and the %OrderNumber% variable was set to '1234' - renaming to: %filename%-%OrderNumber%.pdf would rename the file 'orderdata-1234.pdf'.

If your rename string doesn't contain a file extension then the Convert To type extension will be used.

In the Save To Path entry, enter or select the local folder to save the converted document to. If no Save To Path is specified then the converted files will be saved in the same folder as the file being converted.

If the converted file already exists it will be overwritten.

You can assign the saved path & filename(s) to a variable by selecting the variable from the Assign Filename(s) To list. You can then use this variable in the Attachments entry on Send Email actions or in any other way.

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), but do not need to keep a local copy afterwards.

Converting HTML To PDF Or Word Formats

Converting HTML files to other formats will only work if the HTML contains absolute links (image files, stylesheets etc), and the those links are accessible. If you want to convert an online web page to PDF you can use the Save As PDF action instead - which allows any URL to be rendered to PDF.

You can also use the HTTP Get action to get HTML from a URL with Convert option set to Convert Relative Links To Absolute Links. Save the HTML to a file using the Read Or Write Text File action and then convert this.

Markdown text files ('.md') will be converted to HTML first before being converted to the Convert To file type.


Convert Document To Text

The Convert Document To Text automation action enables you to parse and extract text data from Word, PDF, Open Document, Excel, RichText, Markdown and HTML attachments or local document files. Documents are converted to plain text which is then assigned to a variable, which can then be used further in your automation workflow. This action can also extract PDF form data.

Select a Document To Convert - this can be any local file or a %variable% replacement. You can specify multiple documents if required, separated by commas (any file paths that contain commas must be enclosed in quotes).

Enable the Include Incoming Attachments option to convert attached documents matching the Matching Mask. Enter *.* to convert all supported attachments.

Select the variable to receive the plain text from the Assign To list.

The document(s) will be converted to plain text. Excel files will be converted to CSV or Markdown text. Markdown documents will be converted to HTML first and then the HTML converted to plain text.

If multiple files are converted within the same action then the extracted text from each file will be appended to the returned text.

PDF Extract Form Data

Enable the PDF Extract Form Data option to extract only form data from PDF files. If enabled then form data only will be extracted in the following format:

{form field Name}: {value}
{form field name}: {value}
...

Enable the Return PDF Form Data As Json option to return the form data as Json text.

PDF Use OCR For Image Only Documents

When converting PDF documents, if the PDF document only contains images (for example, a scanned document). Then OCR will be used to extract the text. This option will only be used if the PDF document contains images only and no actual text. Requires Tesseract to be installed.

PDF Text Extract Mode

When converting PDF documents to text you have a number of options:

  • Keep Positioning Method 1 : Some positioning will be retained.
  • Keep Positioning Method 2: Same as above but using a different extraction method. This may provide a more accurate plaintext representation of the PDF document in some cases.
  • Keep Reading Order Method 1 : The text will be extracted in reading order - with no positioning indentation.
  • Keep Reading Order Method 2 : Same as above but using a different extraction method.
  • Extract To CSV : Extracts each text element to CSV text with columns: Page, Bounds (left,top,right,bottom), Text, Font, Size, Weight, RGB. The CSV will contain a row for each text element.

When converting Excel files and the Excel Extract All Worksheets option is enabled, then all worksheets will be extracted and appended to the output text, otherwise, only the first worksheet is extracted.

When converting Excel or CSV files and the Excel/CSV To Markdown Table option is enabled, then the CSV data will be converted to a Markdown table

Enable the Remove Repeated Blank Lines option if you need repeated blank lines removed from the text. This option is useful in cases where there is differing amounts of blank space in the PDF document which your extraction rules do not need.

Enable the Add MetaData option to include file metadata with the output text. Metadata includes the file name, path, size, created date, modified date, author, title, subject, keywords etc. See the Get Document Information action for more information.

You can then use the text in other actions - or use Extract Field actions to parse & extract data from the text.

To test the text extraction select or enter a document and click the Test button. The results will be displayed. Click the Copy button to copy the extracted text to the clipboard. You can then paste this into the Extract Field Helper Message if you need to extract data from the text.


Convert Image To Text Using OCR

The Convert Image To Text Using OCR automation action can be used to convert image files or image attachments to text using optical character recognition (OCR) and assigns the extracted text to a variable. The text can then be used further in your automation workflow. This action can also extract images from PDF files and the convert these images to text. This action uses a local OCR engine.

Select a Image To Convert - this can be any local file or a %variable% replacement. You can specify multiple files if required, separated by commas (any file paths that contain commas must be enclosed in quotes).

Enable the Include Incoming Attachments option to convert attached images matching the Matching Mask. Enter *.* to convert all supported attachments (png, bmp, gif, tiff, jpeg, pdf).

The Language defaults to 'eng' (English). You can specify a different three letter language code. You can download additional language packages from https://github.com/tesseract-ocr/tessdata. These should be copied to the Tesseract tessdata folder.

The Output Type can be text, xml or CSV. If the Preserve Layout option is enabled then space padding is preserved.

Select the Page Segmentation Mode. This controls how Tesseract analyzes the layout of the text in the image - essentially, how it segments and organizes blocks of text before attempting character recognition. Select one of:

Choosing the Right PSM

  • Use PSM 6 for a simple block of printed text.
  • Use PSM 1 or 3 for full pages with mixed layout.
  • Use PSM 7 or 8 for single lines or words, such as in scanned forms or boxes.
  • Use PSM 11 or 12 for images with scattered text fragments.

If Auto Rotate is enabled then the Tesseract will be called first to detect how the text is aligned (PSM 0). The image will be rotated if required. If all of your images are correctly aligned then you should not enable this option - since it requires additional processing time.

If multiple images are converted within the same action then the extracted text from each image will be appended to the returned text.

Select the variable to receive the plain text from the Assign To list.

To test the text extraction select or enter an image file and click the Test button. The results will be displayed.

You can also use the Ask AI action with the 'Ask AI To Respond To A Prompt With An Image' operation to perform OCR on images.

This action uses the open source Tesseract OCR library. Tesseract is not installed by default with the ThinkAutomation setup. If Tesseract is not installed the Install Tesseract button will be visible.


Get Document Information

The Get Document Information automation action can be used to read file and document metadata. The metadata can be returned to a variable in text or Json format

Select a Document To Read - this can be any local file or a %variable% replacement. You can specify multiple files if required, separated by commas (any file paths that contain commas must be enclosed in quotes).

Enable the Include Incoming Attachments option to convert attached documents matching the Matching Mask. Enter *.* to read all attachments.

From the Return As list, select Text or Json.

Select the variable to receive the plain text from the Assign To list.

This action reads file information (size, modified date etc.) and for PDF, Word, Excel, OpenDoc and HTML files it reads metadata.

Document information returned as text:

Path: D:\TestDocs\CreateDoc.docx
Name: CreateDoc.docx
Extension: docx
MimeType: application/vnd.openxmlformats-officedocument.wordprocessingml.document
Size: 5520
Created: 2024-07-24T06:50:53.5095152+01:00
Modified: 2024-07-24T06:58:42.742367+01:00
Description: 
Version: 
Product: 
Application: Microsoft Office Word
Author: Julia Irish
Category: 
Comments: 
Company: Parker Software
Keywords: 
Last Saved By: Julia Irish
Manager: 
Status: 
Subject:
Title: Test Document

Not all fields will have values (depending on the source file). Fields with blank values will not be returned when using the Text return as type.

If multiple files are included in a single action, then the text for all files will be returned (separated with a blank line).

Document information returned as Json:

{
  "Path": "D:\\TestDocs\\CreateDoc.docx",
  "Name": "CreateDoc.docx",
  "Extension": "docx",
  "MimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  "Size": 5520,
  "Created": "2024-07-24T06:50:53.5095152+01:00",
  "Modified": "2024-07-24T06:58:42.742367+01:00",
  "Description": "",
  "Version": "",
  "Product": "",
  "Fields": {
    "Application": "Microsoft Office Word",
    "Author": "Julia Irish",
    "Category": "",
    "Comments": "",
    "Company": "Parker Software",
    "Keywords": "",
    "LastSavedBy": "Julia Irish",
    "Manager": "",
    "Status": "",
    "Subject": "",
    "Title": "Test Document"
  }
}

All fields are returned when Json is used - even if the field has no value. If the file has no metadata (for example a plain text file) then the Fields property will be null.

If multiple files are included in a single action, then a Json array is returned.


Convert PDF Document

The Convert PDF Document automation action can be used to convert PDF files or attachments to various image formats, html or text.

Select a PDF Document To Convert - this can be any local PDF file or a %variable% replacement. You can specify multiple documents if required, separated by commas (any file paths that contain commas must be enclosed in quotes).

Enable the Include Incoming Attachments option to convert attached documents matching the Matching Mask. Enter *.* to convert all PDF attachments.

From the Convert To list, select the type of file to convert the PDF document(s) to.

You can specify a Page Range to convert. Leave this entry blank to convert all pages in the document. Or specify a single page, a range (eg: 1-10) or a comma separated list of pages (eg: 1,3,5).

PDF To Image Conversion

PDF files can be converted to the following image formats: PNG, GIF, BMP, JPEG and TIFF.

For image conversion you can optionally specify the Width and Height. Leave both as zero to leave the size unchanged. If only one of the Width or Height is specified, then the specified dimension will be respected and the other dimension will be calculated so that the original aspect ratio is maintained.

For Image conversion you can specify the Resolution. Larger resolutions will result in bigger converted files and increase conversion time.

For Image conversion enable the Color option if you want full color images created. Otherwise the images will be Grey-scale.

PDF To TIFF Conversion

For conversion to TIFF image files you can enable the TIFF Multi-Frame option. If this is enabled then all pages will be converted to separate frames within the same image file.

You can also specify the TIFF Compression format. Supported compression formats are: Zip, Lzw, Rle, Ccitt3, Ccitt4 and None. Set to 'Default' for the best possible compression.

Converted files will have the same name as the original but with the new file extension. For image files, each page in the PDF document will be converted to a separate image file. The page number will be added to the filename, eg: document_1.tiff, document_2.tiff. You can rename the converted file by entering the new filename in the Rename Converted Files To entry. Use the field replacement %filename% to include the original file.

Specify the folder to save the converted files to in the Save To Path entry.

You can assign the full 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 Filename(s) To list. Multiple files will be separated by commas. You can use this variable on the attachments entry of outgoing emails if you wanted to send the converted files via email.

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), but do not need to keep a local copy afterwards.


Append To PDF Document

Append document content or any text to a PDF document.

Enter or select the PDF File To Append To. This can be a %variable%. If the existing PDF file does not exist it will be created.

Appending Other Documents

You can append other documents and attachments. Supports PDF, Word, Excel, Richtext, OpenDoc, HTML, Text and Markdown files.

Select a Append Documents - this can be any local document file or a %variable% replacement. You can specify multiple documents if required, separated by commas (any file paths that contain commas must be enclosed in quotes).

Enable the Include Incoming Attachments option to append attached documents matching the Matching Mask. Enter *.* to append all supported document types.

Appending Custom Text

In the Append Content entry, you can specify any text to append. This can contain %variable% replacements. You can use plaintext, Markdown or HTML.

You can append Documents or Text Content, or both.

The updated PDF file can be saved with a new name. Specify the Rename Appended File To.

The updated PDF file can be saved to a different location. Specify the Save To Path.

If the original file is not renamed or not saved to a new location then the original PDF file will be updated.

The updated file name can be returned to a variable selected from the Assign Filename To list.

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), but do not need to keep a local copy afterwards.


Convert PowerPoint Document

Converts PowerPoint files or attachments to various image formats or PDF.

Select a PowerPoint Document To Convert - this can be any local PowerPoint file or a %variable% replacement. You can specify multiple documents if required, separated by commas (any file paths that contain commas must be enclosed in quotes).

Enable the Include Incoming Attachments option to convert attached documents matching the Matching Mask. Enter *.* to convert all PowerPoint attachments.

From the Convert To list, select the type of file to convert the PowerPoint document(s) to.

PowerPoint To Image Conversion

PowerPoint files can be converted to the following image formats: PNG, GIF, BMP, JPEG, TIFF, WMP and SVG.

You can specify a Slide Range to convert. Leave this entry blank to convert all slides in the document. Or specify a single slide, a range (eg: 1-10) or a comma separated list of slides (eg: 1,3,5).

For image conversion you can optionally specify the Width and Height. Leave both as zero to leave the size unchanged. If only one of the Width or Height is specified, then the specified dimension will be respected and the other dimension will be calculated so that the original aspect ratio is maintained.

For Image conversion you can specify the Resolution. Larger resolutions will result in bigger converted files and increase conversion time.

For Image conversion enable the Color option if you want full color images created. Otherwise the images will be Grey-scale.

PowerPoint To TIFF Conversion

For conversion to TIFF image files you can enable the TIFF Multi-Frame option. If this is enabled then all slides will be converted to separate frames within the same image file.

You can also specify the TIFF Compression format. Supported compression formats are: Zip, Lzw, Rle, Ccitt3, Ccitt4 and None. Set to 'Default' for the best possible compression.

Converted files will have the same name as the original but with the new file extension. For image files, each slide in the PowerPoint document will be converted to a separate image file. The page number will be added to the filename, eg: document_1.tiff, document_2.tiff. You can rename the converted file by entering the new filename in the Rename Converted Files To entry. Use the field replacement %filename% to include the original file.

Specify the folder to save the converted files to in the Save To Path entry.

You can assign the full 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 Filename(s) To list. Multiple files will be separated by commas. You can use this variable on the attachments entry of outgoing emails if you wanted to send the converted files via email.

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), but do not need to keep a local copy afterwards.


Sign PDF Document

Adds a digital signature to a PDF document.

Select a Sign PDF Document - this can be any local PDF file or a %variable% replacement. You can specify multiple documents if required, separated by commas (any file paths that contain commas must be enclosed in quotes).

Enable the Include Incoming Attachments option to sign attached documents matching the Matching Mask. Enter *.* to sign all PDF attachments.

You must then select a Certificate. This can be either an existing certificate stored in the Windows Certificate Store (specify the Common Name - ThinkAutomation will search for a certificate matching the Common name.) or a PFX file (you must also specify the PFX Password).

Optionally specify a Timestamp URL (eg: http://timestamp.digicert.com) if you want the signature to include a timestamp.

Signature Box

Enable the Show Signature Box option to add a visual signature box to the PDF. If this option is disabled then the PDF will still be digitally signed, but will have no visual signature box.

The signature box can be added to the first or last page. Select from the Add To Page list. It will be positioned on the page using the Placement (eg: top/left, or bottom/middle).

You can optionally add an Image (for example, a green tick mark) and set the Image Placement & Image Opacity.

You can specify up to 3 lines of text to add to the signature box. The text can contain %variable% replacements.

Saving Signed Documents

Signed PDF documents by default will have the same name as the original. You can rename the signed PDF document by entering the new filename in the Rename Signed Files To entry. Use the field replacement %filename% to include the original file.

Specify the folder to save the signed documents to in the Save To Path entry.

You can assign the full path & file name to a ThinkAutomation variable to use on subsequent actions (for example, if you wanted to attach the document to an outgoing message). Select from the Assign Filename(s) To list. Multiple documents will be separated by commas. You can use this variable on the attachments entry of outgoing emails if you wanted to send the signed documents via email.

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), but do not need to keep a local copy afterwards.


Save As PDF

Renders the incoming message, an image file or any HTML content/file or 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 body as it would appear in a web browser - including all images.

Render HTML Content, File or URL

To render any HTML content/file or URL. Enter the file path or full URL to the web page you want to save as a PDF (or a %variable% containing a file path or URL). You can also specify a %variable% containing raw HTML instead of a filename if you want to use HTML content generated earlier in your Automation.

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.

Word Merge

Performs a mail merge on a Microsoft Word document or Word Attachments and saves the merged document as a new file.

This action takes a Word Document and replaces all the mail-merge fields in the document with ThinkAutomation variable values. The resulting merged document is then saved.

Specify the Word File or select Merge Word Attachments and enter a File Mask to use any Word Documents attached to the message.

In the Save Merged Document To enter the new name for the merged document. You can use the special %filename% replacement to use the original file name in part of the new filename. If no name is specified then the original document will be saved.

In the Save To Path specify the folder to save the new document in.

The merged document path & filename can be assigned to a ThinkAutomation variable. Select the variable to use from the Assign Filename(s) To list.

Select Delete After Message Is Processed if you want ThinkAutomation to delete the file after it has finished executing all actions for the current message.

You must then map the Word Document Merge Fields to ThinkAutomation fields/variables. Click the Get Fields From Word Doc to extract mail merge fields from any Word Document. You can also just type them in the list.

Specify each mail Merge Field and the Value to assign the field to. This can be a fixed value or any ThinkAutomation Field, Variable or Built-in Variable.


Print

The Print automation action can be used to automatically print the incoming message, a report of extracted fields, document attachments or a specific local document/file.

Enable the Print The Incoming Message option to print the incoming message.

Enable the Print Extracted Fields option to print a table showing extracted field names and values.

Enable the Print PDF Attachments option if you want ThinkAutomation to print PDF file attachments.

Enable the Print Document Attachments option if you want ThinkAutomation to print any Word, Excel, PowerPoint, HTML or Text documents.

You can also a specify Print File. This can be any PDF, Word, Excel, PowerPoint, HTML or text file or a %variable% containing a file path.

You can pre-select the printer to use from the Printer list. This can be a %variable% replacement if you need to conditionally select a printer in a previous action.

If you select a network printer the ThinkAutomation service may not have permission to print to it. This is because the ThinkAutomation service runs under the SYSTEM account by default and the SYSTEM account cannot access any network resources. See: Changing The User Context.


Run A Report

Creates a report using a pre-defined report template. Reports can be printed, and/or exported to various formats, including PDF, HTML, Rich text and Excel. Exported reports can be attached to outgoing emails.

Enter a Report Name.

Click the Edit Report to start the Report Designer

Using The Report Designer

ThinkAutomation includes a report designer that allows you to create custom report templates. Reports can use ThinkAutomation variable data and link to external data sources.

The Extracted Fields/Variables and built-in variables will be listed in the report designer Explorer pane - Fields List. You can drag any of these onto the report designer surface.

After you have dragged a field to the designer, click it to edit its properties in the Properties Toolbox. You can change colors, alignment, borders, fonts etc. You should also re-size the field so that it will fit the data contents. (Note: If the 'Can Grow' property is set to True then the field height will grow automatically based on the field content).

You can also drag other objects onto the report (Labels, Images, Text Boxes, Charts etc). External data sources can be added using the Add Data Source button.

Click Save in the report designer to save the template.

Click Report Designer End-User Documentation to view detailed report designer documentation.

Enable the Export Report option to export the report at run time. Select the file format from the Export Format list. Available types are:

  • PDF
  • DOCX (Microsoft Word)
  • XLSX (Microsoft Excel)
  • PNG, JPEG
  • TXT, RTF
  • HTML
  • MHT

Use the Assign Export Filename To list to select a ThinkAutomation Variable to assign the exported file name to. You can then use this %fieldname% on other Actions - such as the Send Email action to add the exported report as an attachment.

Enable the Print option to also print the report.