Package Builder doesn't merge documents itself. To turn a package into one PDF, you add a PDF Merger step: PDF Merger, a separate Quickbase Extension, runs after the other steps and combines their documents. There are two ways to add the step:
A PDF Merger template in the sequence—a Document Templates record with Add-On set to PDF Merger, placed last in Package Builder Template Sequence.
The mergeargsfid parameter—added to the button and batch arguments, so Package Builder adds a merge as the final step on its own.
Either way, the merge runs with PDF Merger's own batch arguments, read from a field on the master table. You need PDF Merger installed and set up first; see Set up PDF Merger with the installation wizard.
Before you start: the PDF Merger arguments field
Both ways need a field on the master table that holds the PDF Merger batch arguments for the record. When you set up PDF Merger with its installation wizard, this is the Formula - Text field named PDF Merger Parameters. Write it as you would for PDF Merger's own batch processing, so it:
lists the documents to merge—for example the file attachment fields the other steps save to, in the order the pages should appear (PDF Merger's simple merge), or a query on a related table with a sort field (PDF Merger's merge via query);
says where to save the merged PDF and what to name it;
includes PDF Merger's own Config Key as configid=<your PDF Merger Config Key>. The PDF Merger installation wizard adds it to PDF Merger Parameters; keep it.
Package Builder passes this field to PDF Merger as it is. Test the field with PDF Merger on its own, then note its field ID: select ... (more options) next to the master table in the left bar, select Fields, search for the field, and read the Field ID column. For the parameters, see PDF Merger Formula Text field parameters.
Note
The page order of the merged PDF, which files are included, the file types PDF Merger accepts, and where the result is saved all come from PDF Merger's arguments and settings, not from Package Builder. The template sequence only decides when each document is created. See PDF Merger features and functionality and Formula Text field parameters.
Batch configurations and the merge
Batch configuration checking is on for every account, and the merge step runs PDF Merger in batch—from the button as well as in the background. So PDF Merger checks the merge step's arguments against its own batch configuration, not Package Builder's:
The configuration the PDF Merger wizard creates checks clientid and appid. If you've added more parameters to it in the Batch Config Portal, the merge step's values for them must be allowed there too.
The other steps are checked against their own configurations. The configurations that the Exact Forms Plus, XL Docs, and PDF Stamper wizards create allow only empty values for their merge options (mrgdbid, mrgfa, mrgkeyfid) and only the wizard's own output field in faid. If you add merge options to one of those steps, or point its faid at a different field for the merge to read, update that extension's configuration first. Otherwise that step fails, or its document isn't created.
See Each step's own batch configuration, Create and manage batch configurations, and Use a configuration in batch runs.
Option 1: Add a PDF Merger template to the sequence
Create the template
Open the Document Templates table and select + New Document Template.
In Name, enter a name users will recognize in the progress window, such as Package PDF Merge. The step doesn't need a template file.
In Add-On, choose PDF Merger.
In Arguments FID, enter the field ID of the PDF Merger arguments field, for example 60.
Leave Not Required in Package unchecked, unless the package is still useful without the merged PDF.
Save, and note the new template's Record ID#.
Add it to the sequence
On the master table, open the fields (... next to the table, then Fields), select Package Builder Template Sequence, and add the new Record ID# at the end of the sequence, so the merge runs after every document it merges has been created. For example, with a cover letter (template 4), a schedule (template 3), and the merge template (7):
// Cover Letter = 4, Project Schedule = 3, Package PDF Merge = 7
"4.3.7"The progress window then shows the merge as its own step, with its name (Package PDF Merge) and Template # (7).
Option 2: Add mergeargsfid to the button and batch arguments
With mergeargsfid, you don't need a template record or a change to the sequence. Package Builder adds a final step that runs PDF Merger with the arguments in that field.
Edit the button. On the master table, open the fields and select Process Package (Progress Bar). (On a record, you can also right-click the button and select Field settings.) Inside Base64Encode(), after the pckgsq line, add a line with your field ID:
& "&pckgsq=" & [Package Builder Template Sequence] & "&mergeargsfid=60" // PDF Merger arguments field, merges the documents at the endEdit the batch arguments. Open Package Builder Batch Arguments and add the same parameter. Here parameters are separated by spaces, so start it with a space:
& " pckgsq=" & [Package Builder Template Sequence] & " mergeargsfid=60" // PDF Merger arguments fieldSave both fields.
The button starts a run in the pop-up; the batch arguments start a run in the background. Add mergeargsfid to whichever you use—usually both, so the two give the same package. mergeargsfid isn't in Package Builder's batch configuration as the wizard creates it, so adding it doesn't change that configuration.
In the progress window, the final step is named Document Merge, with Template # N/A and Document Type PDF Merger. If the last template in the sequence already uses the same arguments field, Package Builder doesn't add a second merge. If this step fails, the status field shows Error Encountered on PDF Merger, with no Template #. PDF Merger writes its own reason to the Merger Error Details field on the record; see A step failed: where that extension records why.
Which to use
Use | When |
|---|---|
A PDF Merger template | The merge should show its own name in the progress window; different sequences on the same table merge differently, or only some of them merge; you want the merge somewhere other than last—for example a merge followed by a PDF Stamper step that stamps the merged PDF; or the merge should be optional (Not Required in Package or :u). |
mergeargsfid | Every package from this button and these batch arguments always ends with the same merge, and you'd rather not add a template record or touch the sequence. |
What the user gets
When the merge step finishes, the merged PDF is where the PDF Merger arguments save it—for example a Project Package file attachment field on the record. The separate documents from the earlier steps stay where their extensions saved them. If a required step before the merge fails, the package stops and the merge doesn't run.
To build the package in a separate table of documents instead of fields on the record—and to include fixed files such as terms and conditions—see Repository mode.
Learn more
If you have questions, submit a technical support case.