Attachments inside the PDF
A placeholder can bring an attachment field’s files into the generated PDF, not just their names: a reimbursement claim that ends with its receipts, a payment request with the supplier’s invoice behind it, an inspection report with its photos.
Add the files at the end
Section titled “Add the files at the end”Put the placeholder on a line of its own in your Word template:
{ATTACH:Receipts}In the PDF, after the document’s own pages, every file of the Receipts field follows, in the order they are in the field:
- PDF files: their pages, as they are.
- Pictures (PNG, JPEG, WebP, GIF): one per page, fitted to the page with a margin, turned upright the way the phone took them.
- Word, Excel and PowerPoint files (also OpenDocument and RTF): converted to PDF, then added.
- Anything else (a ZIP, a video) is left out, and the document’s warnings name the file.
The line holding the placeholder is removed from the document.
Several placeholders can be used; their files follow one another in the order the placeholders appear. {ATTACH:*} adds the files of every attachment field, in field order.
The Variables screen offers both forms for each attachment field, under Files in the PDF.
Add the files in place
Section titled “Add the files in place”Add | inline to put the files at that point of the document instead of at the end:
Receipts:{ATTACH:Receipts | inline}Approved by: ________The document stops, the files’ pages follow, and the document carries on on a new page after them. Page numbers in the footer keep counting through the attached pages.
An inline placeholder inside a table or a text box cannot hold whole pages: its files are added at the end, with a warning.
Where the files come from
Section titled “Where the files come from”| Placeholder | Files |
|---|---|
{ATTACH:Receipts} |
the record’s Receipts field |
{ATTACH:Supplier.Contract} |
the Contract field of the linked Supplier record(s) |
{ATTACH:*} |
every attachment field of the record |
{ATTACH:Records.Receipts} |
in a list document, every record’s receipts, record by record |
{#Records} … {ATTACH:Receipts} … {/Records} |
each record’s receipts, in record order |
In a page-per-record document, {ATTACH:Receipts} is each record’s own field: placed at the end of the template with | inline, every record is followed by its own receipts; without | inline, all of them come after the last record, record by record.
Approval documents can attach a form’s Attachment and Image fields the same way: {ATTACH:Quotation}.
A placeholder inside an {#if} block that is not shown attaches nothing.
PDF only
Section titled “PDF only”Attachments are added to PDF documents. When the template’s output format is Word or PNG, the placeholder is removed and the document’s warnings say that attachments only go into PDFs. A template that makes one document from many records is made as a PDF even when set to PNG, so its attachments go in.
Limits
Section titled “Limits”Per document: at most 50 files, 300 attached pages and 40 MB of files, and 20 MB per file. Files over a limit are left out and listed in the warnings; the document is still generated. A PNG, WebP or GIF picture of more than 40 megapixels is also left out, with a warning.
A password-protected or damaged PDF, or a file the converter cannot open, is left out with a warning naming it. It never fails the document.
Good to know
Section titled “Good to know”- Attaching files makes the PDF larger and the generation slower: each Office file is converted separately.
- A large photo is added at full quality. If your PDFs grow too big, ask your colleagues to attach smaller pictures, or turn them into a PDF first.
- A document sent for signature is signed without its attached files: the signed PDF does not include them.