There are two ways to tell PDF Merger which files to merge: merge with a configuration, where you list each file, or merge with a query, where PDF Merger merges the files on every record a query or report returns. You choose one in the PDF Merger Parameters formula field. The installation wizard calls them Configuration Setup and Query Setup.
Which option to use
Merge with a configuration | Merge with a query | |
|---|---|---|
Use it when | You know exactly which files to merge—for example, a cover page, the record's own document, and a closing page. | You want every file that matches some criteria—for example, the attachments on all the child records of a project. |
Files can come from | Any records in any tables, and each file can be in Quickbase, Amazon S3, or Dropbox. | The records of one table. All files come from the same kind of storage. |
Number of files | Fixed: one entry per file. The wizard sets up to five; you can add more in the formula. | Changes with the data: one or more files for each record the query returns. |
Order of files | The order you list them. | The query's sort order, then the order of the fields on each record. |
Main parameter |
|
|
Use one option per PDF Merger Parameters field. If the field has both Configuration and msqry or msqid, or both msqry and msqid, PDF Merger doesn't merge anything.
Both options also use the same general parameters—clientid, appid, apptoken, errorfid, mrgdte, triggerfid, type, and configid. See Formula Text field parameters.
Note
Type parameter names exactly as shown on this page—they're case-sensitive (for example,
S3=Y, nots3=Y). Parameters are separated by spaces, so no value can contain a space.
Merge with a configuration
The Configuration parameter is a list of entries separated by a pipe (|). Each entry points to one file. The last entry is different: it says where to save the merged PDF.
Configuration={file 1}|{file 2}|...|{where to save}The basic entry is a table, a record, and a file attachment field:
{table dbid}:{Record ID#}-{file attachment field ID}For example, bq5d6e7f8:12-6 is the file in field 6 of record 12 in table bq5d6e7f8.
Example: an employee welcome package
This formula merges a cover page (record 12 of a Document Templates table, field 6), the employee's own document (field 10 on the record PDF Merger runs from), and a closing page (record 15 of Document Templates), and saves the result to field 25 on the same employee record:
"Configuration=" & [_DBID_DOCUMENT_TEMPLATES] &":12-6|"
& Dbid() & ":" & [Record ID#] & "-10|"
& [_DBID_DOCUMENT_TEMPLATES] & ":15-6|"
& Dbid() & ":" & [Record ID#] & "-25"
& " fn=Welcome_Package"Use Dbid() and [Record ID#] for the record PDF Merger runs from, and a table alias such as [_DBID_DOCUMENT_TEMPLATES] for other tables. fn is the merged file's name, without spaces.
Files from Amazon S3 or Dropbox
An entry can point to a file in Amazon S3 or Dropbox instead. The field ID is then a field on the record that stores the file's S3 key or Dropbox file name. You can mix Quickbase, S3, and Dropbox entries in the same configuration.
Where the file is | Entry | Example |
|---|---|---|
Quickbase file attachment field |
|
|
Amazon S3, your account's bucket |
|
|
Amazon S3, another bucket |
|
|
Dropbox, your account's folder |
|
|
Dropbox, another folder |
|
|
Where the merged PDF is saved
The last entry in the configuration says where to save the merged PDF:
Save to | Last entry | What happens |
|---|---|---|
A file attachment field |
| The merged PDF is saved to that field. The record must already exist; it can be in another table. |
Amazon S3 |
| The merged PDF is saved in your account's bucket, or the bucket you name, with a new key: the file name, table, record, and five random characters (for example, |
Amazon S3 with your own key |
| The same, but the third part is the key itself (not a field ID), so you can build it in the formula. The key is written to the field. |
Dropbox |
| The merged PDF is saved in that Dropbox folder as |
Good to know
If a source field is empty, PDF Merger skips that file and merges the rest.
Bucket and folder names in the configuration can't contain a hyphen (
-), because the hyphen separates the record from the field.To merge more than the five files the wizard sets up, add more entries before the last one.
Merge with a query
With a query, PDF Merger finds the records in one table, then merges the files on each of them. You give the table, the query or report, the fields that hold the files, and where to save the result.
Parameter | Description | Sample |
|---|---|---|
| The table to take the files from. |
|
| A Quickbase query that picks the records. Use either |
|
| The ID of a report on the |
|
| With |
|
| The field to sort the records by. Defaults to Record ID# ( |
|
| The table to save the merged PDF in. |
|
| The Record ID# of the record to save it on. The record must already exist. |
|
| The file attachment field to save it in. |
|
| The merged file's name, without spaces. Required for a query merge. |
|
Example: every job's timesheet on a project
This formula, on a Projects table, merges the Job Timesheet file (field 8) of every Jobs record whose Related Project (field 6) is this project, sorted by Record ID#, and saves the result to field 10 on the project:
"msqry={'6'.EX.'" & [Record ID#] & "'}"
& " clist=3.8"
& " slist=3"
& " dbid=" & [_DBID_JOBS]
&" mrgdbid=" & Dbid()
&" mrgrid=" & [Record ID#]
&" mrgfa=10"
& " mrgfn=Project_Timesheets"The query can't contain spaces either, so match on IDs or values without spaces—for example, a Record ID# or a status code.
Files in Amazon S3 or Dropbox
If the records store S3 keys or Dropbox file names instead of attachments, add these parameters. PDF Merger then reads those fields instead of file attachment fields.
Parameter | Description | Sample |
|---|---|---|
| The field that stores each file's S3 key. |
|
| Optional. A field that stores each file's bucket, if the files are in different buckets. |
|
| Optional. The bucket to use instead of your account's bucket. |
|
| The field that stores each file's Dropbox file name. |
|
| The field that stores each file's Dropbox folder. Required with |
|
Saving the merged PDF to Amazon S3 or Dropbox
Amazon S3: add
S3=Y. PDF Merger saves the merged PDF with a new key (or the key incstmkey), in your account's bucket or the one ins3bkt, and writes the key to themrgfafield—use a text field for it.Dropbox: add
DB=Yanddbfolder={folder}. PDF Merger saves the merged PDF as{mrgfn}.pdfand writes that name to themrgfafield.
Good to know
If the query returns no records, PDF Merger writes There are no records retrived for the query to the error field.
Records with an empty file field are skipped.
Limits
Your account has a maximum number of files per merge and a maximum size for the merged PDF. If a merge goes over either one, PDF Merger stops and writes the reason to the error field.