Skip to main content

Create PDF action

Turn record values into a PDF file. Set the file name, page size, orientation, and margins, preview the result, and use the file in later actions.

Written by Leo

Create PDF is an action that builds a PDF file from a layout you write and saves the file in a variable (the trigger decides when the automation runs, and the action decides what happens). It's meant to help you produce documents like invoices or reports without opening a template by hand.

You can use this action for many things, including:

  • Creating an invoice PDF when an installation is marked as completed.

  • Putting the open tasks of a project into a status report.

The action Create a PDF and save file in PDF with the File name box, Show more, the Body box, and Show preview

Note:

  • The PDF isn't stored on a record by itself. The file lives in a variable for this run. Use it in a later action, for example as an attachment in Send email.

  • Page settings are hidden at first. Select Show more to see the layout: orientation, page size, and margins.

Who can use the Create PDF action?

  • Automations are available on all plans: Free, Plus, and Premium. The number of automation actions per month depends on your plan. See the limits for your plan on our pricing page.

  • To add or change this action, you need to be a Workspace admin of the workspace the app is in. App permissions alone aren't enough.

Add the Create PDF action

To create a PDF from an automation:

  1. Open the database app on desktop or web and click the automations icon in the top bar (tooltip Create and view automations).

  2. Open an automation, or select New automation and choose a trigger.

  3. Select Add action → Create PDF. The step appears as Create a PDF and save file in PDF.

  4. Enter a name in File name. The empty box shows Untitled.pdf, and Type '@' for variables once you click into it.

  5. Write the content of the PDF in the text editor. Select Show more to set the page layout.

  6. Select Show preview to check the result.

  7. Select Create automation for a new automation, or Save changes for an existing one.

Adding Create PDF in an Expenses automation: Add action, selecting Create PDF, entering Expense report in File name, selecting Show more to show the layout Portrait, Letter, and Normal margins, and selecting Show preview

Create PDF settings

File name and the content are always visible:

  • File name: the name of the file. You can mix text with record values, for example "Invoice " followed by the Invoice number field. If the name doesn't end in .pdf, Tape adds .pdf for you. Characters like /, :, or ? are replaced with a dash. If the name is empty, the file is called Untitled.pdf.

  • The content: the body of the PDF. See Content below.

Select Show more to see the layout settings. Next to Layout, three dropdowns set the orientation, the page size, and the margins. The settings appear in this order:

  • Portrait or Landscape: the page orientation. Open the dropdown to switch.

  • Page size: open the dropdown and choose one of these (sizes shown here in inches):

  • Letter (8.5″ x 11″)

  • Tabloid (11″ x 17″)

  • Legal (8.5″ x 14″)

  • A3 (11.69″ x 16.54″)

  • A4 (8.27″ x 11.69″)

  • A5 (5.83″ x 8.27″)

  • Envelope #10 (4.12″ x 9.5″)

  • Custom format lets you enter your own size. Enter Width and Height next to Format.

  • Margins: open the dropdown and choose Normal margins, Narrow margins, Moderate margins, Wide margins, or Custom margins. With Custom margins, you enter Top, Right, Bottom, and Left next to Margins, plus Header and Footer when a header and footer are turned on.

  • Units: page sizes, custom sizes, and margins are shown in centimeters or inches, depending on Measurement system in Settings → Preferences. Learn more about preferences → Values from variables are read as millimeters.

  • Page number: appears when page numbers are turned on. See Header, footer, and page numbers below.

A new action starts with Portrait and Normal margins. The page size is Letter, or A4 if your Tape language is German. Select Show less to hide the settings again.

Content

The content is the body of the PDF. It's visible without Show more. The empty editor shows Body. When a header and footer are turned on, you can hide or show the body with Hide body and Show body. Type @ to insert record values.

  • For more formatting, open the editor in fullscreen with Open in fullscreen (cmd/ctrl + enter). There you find the menus File, Edit, View, Insert, Format, and Table, and a toolbar with font, font size, and text styles.

  • In fullscreen, use Insert to add images, links, buttons, and tables.

  • To edit the HTML, open the editor in fullscreen and select File → Source code. The PDF is rendered like a web page in Chrome, so inline styles, style blocks, tables, colors, font sizes, flexbox, and images from a web address all work.

  • Long content flows onto new pages automatically.

Header, footer, and page numbers

Open the action's menu ••• and turn on Header and footer or Page numbers under Settings.

  • With Header and footer, you write a header and a footer. Choose Same across entire PDF, or Different first page to write one for the First page and one for the Other pages. Use Show header or Hide header and Show footer or Hide footer to show or hide the editors.

  • With Page numbers, set Format and Start at under Page number. Page numbers can use numbers (1, 2, 3), numbers with a leading zero (01, 02), letters (a, b, c or A, B, C), or Roman numerals. Type @ and select Page number or Page count under PDF to insert them, for example in the footer.

Preview the PDF

Select Show preview to see the PDF with your layout. The preview has two controls:

  • Exit preview closes the preview.

  • Simulate variables lets you choose a record. Tape runs a simulation up to this action and fills the preview with that record's values, without changing any data.

Hover over the buttons to see their shortcuts. Show preview has the tooltip Show preview and simulate variables (option/alt + P), and Simulate variables has Start simulate variables (option/alt + S). In the editor, Open preview in new tab opens the preview in a new browser tab.

Use the PDF in later actions

The action saves the file in a variable named PDF. Later actions can use it:

  • In Send email, open Attach file and select the PDF variable. It's listed with the file fields.

  • To store it on a record, add Update record, add the file field, choose Add files, and select the PDF variable.

  • In Send HTTP request, you can insert the PDF's file URL into the request. The file itself isn't sent as an upload.

Let's look at an example

Let's say your solar installation team wants to send the customer an invoice when an installation is completed. Here's how:

  1. Set the trigger to When a record is updated and select the Status field.

  2. Add the filter Where Status Has changed to "Completed".

  3. Select Add action → Create PDF.

  4. In File name, enter "Invoice " followed by the Installation number field, then ".pdf".

  5. Select Show more and choose A4. Write the invoice in the content: the customer's name, the address, and the Total field.

  6. Select Show preview to check the layout.

  7. Select Add action → Send email, send it to the customer, and attach the PDF.

  8. Select Create automation.

The next time an installation is completed, the customer gets an email with the invoice PDF attached.

Create PDF errors

  • If the preview is empty, the content has no text yet, or a record value has no data. Select Simulate variables to check.

  • If the step fails, the run shows the step and its message. Open the automation and click ▷ next to Manual run (tooltip View all runs), or press cmd/ctrl + 1. Each run shows its status, for example Success; select a run to see every step. For all automations, open Runs in the Automation Center and filter by App, Automation, or Status. A successful step shows the name of the created file.

  • If a PDF takes too long to create, the step fails. A very long PDF or one with many large images can take too long. Split the content, or use smaller images.

  • If special characters look wrong, check the content in the preview.

Test, pause, or edit the Create PDF action

  • Manual run runs the automation once. Next to Run on, choose the records, then select Start run. If you have unsaved changes, the button reads Save and start run. Any email you send with the PDF goes to real recipients.

  • To stop only this action, click ••• next to it and turn on Deactivate.

  • To change the PDF, open the automation, select the step, make your changes, then select Save changes.

Learn more

FAQs

Can I choose the page size and orientation?

Yes! Select Show more, then open the dropdowns for orientation, page size, and margins. You can choose from Letter, Tabloid, Legal, A3, A4, A5, Envelope #10, or Custom format.

Can I add a header, footer, or page numbers?

Yes. Open the action's menu ••• and turn on Header and footer or Page numbers under Settings. Then type @ to insert Page number or Page count.

Can I put a table of records in the PDF?

Yes. Collect the records, loop through them to build an HTML table in a variable, then use the variable in the content. Learn more about building an HTML table →

Can I add images?

Yes! Open the editor in fullscreen, select Insert → Image, and enter the image's web address.

Can I attach the PDF to the record?

Yes. Add Update record, choose the file field, select Add files, and pick the PDF variable.

Are there other actions I can use?

Yes! Actions can create and update records, add comments, send emails, create PDFs, call other services, and more. See every action in Automation actions →

Are you a developer using the Tape API for automations?

The automation API has its own documentation for developers. Full reference: create_pdf in the developer docs →

Still have questions? Find answers and get help from community experts in the Tape community →

Did this answer your question?