Exact Forms Plus can put other PDF files together with the PDF it creates, so the result is one PDF. For example, you can add a cover letter in front of a quote, or your terms and conditions after an invoice. Three button parameters do this:
Parameter | Where the files go |
|---|---|
| Before each document Exact Forms Plus creates. |
| After each document Exact Forms Plus creates. |
| At the end of the merged document, when one run creates documents for many records and combines them into one PDF. |
The files become pages of the PDF. They aren't attached to it as separate files.
Before you start
PDF output only. The button must create a PDF (
docfmt=pdf). With Word output, these parameters are ignored.PDF files only. Each file you add must be a PDF (its name ends in
.pdf). Other file types are skipped. To combine Word, Excel, or image files, convert them first, or use PDF Merger (see Exact Forms Plus or PDF Merger?).A limit on the number of files. Your account sets how many files one parameter can list. If you list more, the run stops with Too Many ADDFILES (or PREFILES, or MRGFILES).
Not in test mode. With
test=y, these parameters are ignored.
Point to the files
List the files in the order they should appear, separated by periods. Each entry can be one of these:
Entry | The file is in | Example |
|---|---|---|
A field ID | A file attachment field on the record being processed. |
|
| A file attachment field on a record in another table, for example one standard Terms and conditions record. |
|
| The same, but |
|
| Wherever the field's value says. The field, usually a formula text field, holds one or more of the other entries (separated by periods). Exact Forms Plus reads it for each record, so each record can add different files. |
|
| Amazon S3, in the bucket saved for your account. The key can't contain a period (see Things to know). |
|
For example, this button adds a cover letter from field 108 on the record before the document, and the record's attachment in field 109 plus a standard terms file after it:
& "&docfmt=pdf"
& "&prefiles=108"
& "&addfiles=109." & [_DBID_TERMS] & ":1:7"Different files for each record
Use a formula text field with an FID entry when the files depend on the record. For example, field 123 adds the terms record related to this record, and the signed contract in field 110 only if there is one:
[_DBID_TERMS] & ":" & ToText([Related Terms]) & ":7"
& If([Signed Contract] > "", ".110", "")Then use "&addfiles=FID123" in the button. Exact Forms Plus reads field 123 itself, so you don't need to add it to the clist.
If the
FIDfield is the only entry and it's empty, nothing is added.If it's combined with other entries, for example
addfiles=109.FID123, it must not be empty: an empty value stops the run with ERROR - Get Additional Files.
Add files to the end of a merged document
When a button creates documents for many records (msqry or msqid) and merges them (mrgdbid, mrgrid, mrgfa), mrgfiles adds files once, at the end of the merged PDF. For example, a summary sheet after all the invoices.
A plain field ID in
mrgfilesrefers to the record that gets the merged file (mrgdbidandmrgrid), not to the records being processed.table ID:Record ID#:field IDandS3|entries work as in the table above.RIDandFIDdon't.prefilesandaddfilesstill apply to each document inside the merged PDF.
& "&msqry={'6'.EX.'" & [Record ID#] & "'}"
& "&mrgdbid=" & Dbid()
&"&mrgrid=" & [Record ID#]
&"&mrgfa=20"
& "&mrgfn=All Invoices"
& "&mrgfiles=21"For the other merge parameters, see Formula URL parameters.
Things to know
Order. Files go in the order you list them: all
prefiles, then the document, then alladdfiles.Empty or missing files are skipped. If a file attachment field is empty, or a file isn't a PDF, that entry is left out and the rest of the document is still created. Check the result if pages seem to be missing.
Passwords. Don't combine
prefilesoraddfileswithdocpwordocpwo. Withdocpw, the run fails. Withdocpwo, the combined PDF isn't protected.S3 keys. Entries are separated by periods, so an S3 key that contains a period, such as
terms.pdf, doesn't work. Use keys without periods for files you add this way.Access. Files in other tables or apps are read with the user token saved for your account. That token must be able to see them.
Run time. Each document with added files takes a few seconds longer to create.
If something goes wrong
What you see | What to check |
|---|---|
Exact Forms Plus Error: Too Many ADDFILES (or PREFILES, MRGFILES) | The parameter lists more files than your account allows. List fewer files. |
ERROR - Get Additional Files: … | An entry is empty or isn't in one of the formats above, often because an |
We're sorry but something went wrong! The following error occurred in ADDFILES: … | One of the PDFs couldn't be read: it's damaged or password protected, or the document itself has a password ( |
The document is created, but an added file is missing | The field was empty, the file isn't a PDF, the field ID is wrong, or the token can't see the file. Check the entry for that record. |
Nothing is added at all | The button doesn't create a PDF ( |
For other errors, see Troubleshooting.
Exact Forms Plus or PDF Merger?
PDF Merger is a separate Quickbase Extension that also combines files into one PDF. The two work differently:
Exact Forms Plus ( | PDF Merger | |
|---|---|---|
What it does | Adds existing PDFs to a document that Exact Forms Plus is creating from a template. | Combines files that already exist. It doesn't create documents from your Quickbase data. |
When it runs | As part of the Exact Forms Plus run: when a user selects the button, or in a background run of the Batch Processor. The result can open in the browser right away. | In the background. A Quickbase email notification starts each merge, either automatically or from the Execute PDF Merger button. |
File types | PDF only. Other files are skipped. | PDF, plus Word, Excel, text, email (.msg, .eml), and image files, which it converts to PDF first. |
Where the files come from | A file attachment field on the record or on a record in another table, or Amazon S3 (keys without periods). Not Dropbox. | File attachment fields, or Amazon S3 or Dropbox, with the S3 key or Dropbox file name stored in a field. |
Choosing the files | A list in the button. A formula field ( | A list of specific files, or every file on the records that a query or report returns. |
Order |
| The order you list the files, or the query's sort order. |
Where the result is saved | Wherever the button saves the document: a file attachment field, a repository table, or Amazon S3, Dropbox, or Egnyte. | A file attachment field on an existing record, Amazon S3, or Dropbox. |
Limits | Your account sets how many files each parameter can list. | Your account sets the maximum number of files and the maximum size of the merged file. |
Use it when | You're creating a document and want the same kinds of PDFs around it every time, such as a cover page or terms. | The files already exist, aren't all PDFs, are in Dropbox, or come from many records, for example a package of all of a project's documents. |
To combine documents created by several extensions into one package, see Package Builder.