filesoft.Discuss a project
← Practical FileMaker guides

PRACTICAL FILEMAKER GUIDES

Assemble a cover, report and appendix into one PDF in FileMaker 26

Plan a native PDF assembly workflow with a known page order, a controlled record selection and explicit cleanup when an operation fails.

1. Choose a small document with an exact order

A useful report package might contain a cover, selected records and supporting notes. FileMaker 26 adds PDF assembly steps that work with a PDF held in memory. This desktop exercise uses features introduced in version 26.0; it is not a workflow for earlier FileMaker versions.

Use a separate FileMaker Pro 26 practice file and record the exact patch and operating system you test. The outline below is an algorithm to recreate in Script Workspace, not a complete pasteable script or a supplied native demo.

Our target is a three-part package for fictional Cedar Workshop: cover first, a one-page jobs report next, and an appendix last. The two downloadable PDFs are original source fixtures made for this exercise, not output generated by FileMaker or evidence of native execution.

Download the one-page cover PDF ↓

Download the one-page appendix PDF ↓

2. Prepare the report before assembling it

Create Jobs with JobID, Customer and Description as Text fields. Enter C101 and C102 for Cedar Workshop, plus N201 for North Studio. Use short descriptions such as “Outline,” “Review” and “Unrelated job.” Prepare a dedicated report layout headed “Cedar jobs — practice report.”

Find Cedar Workshop, verify exactly C101 and C102, and sort by JobID. Use Preview mode to confirm the report fits one page without clipping. Follow the existing PDF-export guide if the selection or pagination is not yet right. Do not assemble a document around an unverified found set.

Create a separate one-record Assets table with two Container fields, Cover and Appendix. Insert the downloaded PDFs as embedded contents, not file references. Load their contents into variables while on that record, checking each source is present before moving to the Jobs report context. This avoids relying on an unrelated field reference from the report layout.

3. Give the PDF lifecycle one owner

Define which script owns the in-memory PDF. Start only when no other operation is using it. Create PDF fails if another PDF is already open; do not respond by cancelling an object that might belong to another workflow.

Prepare cover and appendix variables; verify sources.
Establish report layout, find and sort; check each result.
Create PDF; save its error immediately.
If creation failed: return failure without cancelling another PDF.
Mark this operation as owning the open PDF.
Append PDF from the cover variable; check error.
Save Records as PDF to Currently open PDF;
  use Records being browsed; check error.
Append PDF from the appendix variable; check error.
Close PDF to a new output file; check error.
Return saved only after Close PDF succeeds.

Configure Append PDF to use Source with the variable containing the PDF. It adds the source’s pages after the pages already assembled. Configure the report export’s destination as Currently open PDF, rather than a separate file. Check all fallible setup operations as well as the PDF steps.

4. Handle a failed append or save

After this operation successfully creates its PDF, a failed append or report export should preserve the original error, cancel this operation’s in-memory PDF and return failure. Check cleanup separately so it cannot disguise the operation that failed. Cancel PDF discards the unsaved document; it is not a save action.

Close PDF can leave the PDF open when the destination cannot be written. Define an explicit retry-to-another-destination or discard path, and verify that path. Do not leave an invisible open PDF that prevents the next attempt.

Choose a new filename in a dedicated practice output folder for every run. Claris documents that an existing destination can be overwritten without an error. Keep email creation off; this exercise ends with an inspected local file, not sending a document.

5. Deliberately exercise failure paths

CaseWhat to verify
All inputs validCover → Cedar report → appendix; three pages after one-page report setup
Missing appendixFailure; no saved-success result; owned PDF cleaned up
No Cedar jobsStop before creating the PDF
Unwritable destinationSaved error; explicit retry or discard
Another PDF already openDo not discard that other workflow’s PDF
Successful next runNo leftover state; inspect new output

Download the assembly and failure checklist ↓

Perform failure tests in the disposable file. Inspect the saved error and the caller’s result rather than depending only on a dialog. For the missing-source test, omit the appendix deliberately and check both your preflight rejection and the implementation’s post-creation failure cleanup through a controlled test case.

These are expected checks, not a claim that the native script has been run. In particular, distinguish a failure before Create PDF from one after it: only the latter leaves a PDF owned by this operation to clean up.

6. Open the actual saved document

Open the result in a PDF viewer. Confirm that the first page says “COVER,” the middle contains only C101 and C102 in order, and the last says “APPENDIX.” N201 must be absent. Count pages, check the final lines and confirm the source PDFs remain unchanged.

If the report expands beyond one page, the package should contain one cover page, all report pages and one appendix page. Update the expected count instead of deleting report content merely to reach three. File existence alone is not a content check.

Finished result: a reviewed PDF package and repeatable failure recovery. Server, Go and WebDirect have their own destination and interaction rules; desktop paths do not establish compatibility there. This generic example does not add a PDF-assembly feature to any shipped Filesoft product.

FileMaker script example

Recreate these steps in FileMaker Pro 26 Script Workspace. Create an Assets layout on an Assets table with exactly one record and two Container fields, Cover and Appendix, each holding a valid one-page PDF. Create a Jobs report layout on Jobs with JobID, Customer and Description. Add exactly two jobs whose Customer is Cedar Workshop. Configure the restored sort on Jobs::JobID ascending and the report’s print setup so those two jobs fit on one page.

Choose Currently open PDF in Save Records as PDF; choose Records being browsed. These are script-step options, not calculation text. Start with no open PDF assembly and no pending record edits. This script changes the layout and found set. It writes a uniquely named file in Documents.

How to use this: recreate the steps and their options in Script Workspace. This is readable script text, not a clipboard snippet or an importable script. These examples have been checked against documentation but have not been executed in a native FileMaker file.

Recreate these steps

FileMaker script

# PDF | Assemble practice packet — FileMaker Pro 26
Set Error Capture [ On ]
If [ Get ( WindowMode ) ≠ 0 or Get ( RecordOpenState ) ≠ 0 ]
    Exit Script [ Text Result: "blocked: finish the current edit" ]
End If
Loop
    Go to Layout [ "Assets" (Assets) ; Animation: None ]
    Set Variable [ $error ; Value: Get ( LastError ) ]
    Exit Loop If [ $error ≠ 0 ]
    Show All Records
    Set Variable [ $error ; Value: Get ( LastError ) ]
    Exit Loop If [ $error ≠ 0 ]
    Go to Record/Request/Page [ First ]
    Set Variable [ $error ; Value: Get ( LastError ) ]
    Exit Loop If [ $error ≠ 0 ]
    Exit Loop If [ 1 ]
End Loop
If [ $error ≠ 0 or Get ( FoundCount ) ≠ 1 ]
    Exit Script [ Text Result: "invalid_assets" ]
End If
Set Variable [ $cover ; Value: Assets::Cover ]
Set Variable [ $appendix ; Value: Assets::Appendix ]
If [ IsEmpty ( $cover ) or IsEmpty ( $appendix ) ]
    Exit Script [ Text Result: "missing_pdf" ]
End If
Loop
    Go to Layout [ "Jobs" (Jobs) ; Animation: None ]
    Set Variable [ $error ; Value: Get ( LastError ) ]
    Exit Loop If [ $error ≠ 0 ]
    Enter Find Mode [ Pause: Off ]
    Set Variable [ $error ; Value: Get ( LastError ) ]
    Exit Loop If [ $error ≠ 0 ]
    Set Field [ Jobs::Customer ; "==Cedar Workshop" ]
    Set Variable [ $error ; Value: Get ( LastError ) ]
    Exit Loop If [ $error ≠ 0 ]
    Perform Find [ ]
    Set Variable [ $error ; Value: Get ( LastError ) ]
    Exit Loop If [ $error ≠ 0 ]
    Sort Records [ Restore ; With dialog: Off ]
    Set Variable [ $error ; Value: Get ( LastError ) ]
    Exit Loop If [ $error ≠ 0 ]
    Exit Loop If [ 1 ]
End Loop
If [ $error ≠ 0 or Get ( FoundCount ) ≠ 2 ]
    Exit Script [ Text Result: "unexpected_found_set" ]
End If
Set Variable [ $path ; Value: Get ( DocumentsPath ) & "Cedar-" & Get ( UUID ) & ".pdf" ]
Create PDF
Set Variable [ $error ; Value: Get ( LastError ) ]
If [ $error ≠ 0 ]
    Exit Script [ Text Result: "create_error:" & $error ]
End If
Loop
    Append PDF [ From: Source ; $cover ]
    Set Variable [ $error ; Value: Get ( LastError ) ]
    Exit Loop If [ $error ≠ 0 ]
    Save Records as PDF [ With dialog: Off ; Save to: Currently open PDF ; Records being browsed ]
    Set Variable [ $error ; Value: Get ( LastError ) ]
    Exit Loop If [ $error ≠ 0 ]
    Append PDF [ From: Source ; $appendix ]
    Set Variable [ $error ; Value: Get ( LastError ) ]
    Exit Loop If [ $error ≠ 0 ]
    Close PDF [ Save to: File ; $path ; Create folders: Off ]
    Set Variable [ $error ; Value: Get ( LastError ) ]
    Exit Loop If [ $error ≠ 0 ]
    Exit Loop If [ 1 ]
End Loop
If [ $error ≠ 0 ]
    Cancel PDF
    Set Variable [ $cleanupError ; Value: Get ( LastError ) ]
    Exit Script [ Text Result: "pdf_error:" & $error & ";cleanup:" & $cleanupError ]
End If
Exit Script [ Text Result: $path ]

Expected result: a three-page PDF in this order: cover, both jobs on one report page, appendix. Inspect the actual PDF: its page count depends on the report’s print setup. A missing container or unexpected found set stops before assembly. A failed Create PDF does not cancel a PDF another script may own. Once creation succeeds, this example deliberately discards its own assembly on a later failure and reports the original and cleanup errors. It does not overwrite an existing named customer document or retry automatically.

References

Use a practice copy and verify the result in your FileMaker version. Product requirements and platform support remain specific to each product.

Filesoft counts page loads and selected resource and practice-download clicks in aggregate. These aggregate counts contain no practice data or visitor identifiers. Browser privacy signals and the site’s analytics-off preference disable these counts.