Print PDF
Prints a PDF file from the specified file path, container field, or variable.
Options
-
From is how the PDF file's location is specified:
-
File specifies a PDF file path. When selected, the Source file option becomes available.
-
Source specifies a PDF file in a container field or variable. When selected, the Source option becomes available.
-
-
Source file defines a list of one or more paths and filenames for the PDF file when From is File. The script step searches the list and uses the first PDF file it successfully locates. Paths must use one of the
imagepath prefixes. See Creating file paths. -
Source specifies the container field or variable that stores the PDF file when From is Source.
-
Password is a text expression for the password required to open an encrypted PDF file. If the PDF file is not encrypted, this option is ignored.
-
Specify print options allows you to specify a printer and other options (
Restoreindicates print options are stored in the script step). When the script runs, the output from this script step is sent to the printer you specified.If you do not specify a printer before saving the script or if the specified printer cannot be found when the script runs, the output from the script step is sent to the user's default printer.
-
Save print options to specifies a container field or variable where the current print settings will be saved for future use. This allows you to capture and reuse print settings across multiple print operations.
-
Use print options from specifies a container field or variable that stores print settings previously saved using the Save print options to option. If not specified, the script step uses the current system print settings.
-
With dialog specifies whether to display the Print dialog when the script step is performed. When On, shows the print dialog for user interaction. When Off, prints using the current or specified print settings without user interaction.
Compatibility
| Product | Supported |
| FileMaker Pro | Yes |
| FileMaker Go | Partial |
| FileMaker WebDirect | Partial |
| FileMaker Server | No |
| FileMaker Cloud | No |
| FileMaker Data API | No |
| Custom Web Publishing | No |
Originated in version
26.0
Description
This script step prints a PDF file directly from a file path, container field, or variable without requiring the PDF to be displayed in a layout. This provides a streamlined way to print PDF documents as part of automated workflows.
The script step can use saved print settings for consistent printing behavior, or display the Print dialog to allow user interaction. Print settings can be saved in a container field or variable and reused across multiple print operations.
This script step is useful for:
-
Automated printing of PDF reports and documents
-
Batch printing of multiple PDF files with consistent print settings
-
Printing PDF content stored in container fields without exporting the PDF file to disk first
Notes
-
For encrypted PDF files, if the password is missing or incorrect, this script step returns error code 607 ("Password missing or incorrect for encrypted PDF file").
-
If the PDF file's security settings don't allow printing, this script step returns error code 608 ("Security settings in PDF file don't allow printing").
-
When you specify a container field that is empty or doesn't contain PDF data, this script step returns error code 605 ("Container field is empty") or 606 ("Specified container data isn't a PDF file").
-
In FileMaker Go, the Save print options to and Use print options from options aren't supported.
-
In FileMaker WebDirect, the From: File, Save print options to, and Use print options from options aren't supported.
Example 1 - Print PDF file with dialog
Prints a PDF file from a container field, showing the Print dialog to allow the user to specify print settings.
Print PDF [ From: Source ; Source: Documents::ReportPDF ; With dialog: On ]
Example 2 - Automated printing with saved settings
Goes to the first record in the Contracts layout. If $$printSettings hasn't already been set, the script prints the PDF file in the Contracts::ContractPDF container field file, displaying the Print dialog so the user can choose the print settings. The settings are saved in the $$printSettings variable. If $$printSettings is already set, the PDF in the first record is print using the saved settings. Then the script loops through the remaining records, printing the PDF file using the same print settings.
Go to Layout [ "Contracts" (Contracts) ; Animation: None ]
Go to Record/Request/Page [ First ]
If [ IsEmpty ( $$printSettings ) ]
Print PDF [ From: Source ; Source: Contracts::ContractPDF ; Save print options to: $$printSettings ; With dialog: On ]
Else
Print PDF [ From: Source ; Source: Contracts::ContractPDF ; Restore: Use print options from: $$printSettings ]
End If
Go to Record/Request/Page [ Next ; Exit after last: On ]
Loop [ Flush: Always ]
Print PDF [ From: Source ; Source: Contracts::ContractPDF ; Restore: Use print options from: $$printSettings ]
Go to Record/Request/Page [ Next ; Exit after last: On ]
End Loop