PDF Formatter
Overview
This Snap reads a document stream and writes it to a new PDF binary output.

- This is a Format-type Snap.
Works in Ultra Tasks
Known issues
- The PDF Snaps perform validation of the files before
processing them. In this process, if the Snap finds a PDF file that is not well-formed, it
displays an error Only PDF files are supported, even when it is a
PDF file.
Workaround: Fix the PDF file using an online or in-house tool and retry.
- The standard PDF fonts available in the Font field cover only Western European characters. They cannot render text such as Chinese, Japanese, or Korean (CJK). To render such text, specify a TrueType font that covers it in the Font file field. Learn more about the Custom font requirements.
- The Snap writes all input documents to a single PDF file. If any document contains a character that the font cannot render, the Snap does not create the PDF file, and the error does not identify the input document. With Discard Error Data and Continue, the Snap discards the entire PDF file, including the valid documents, and the pipeline completes without errors.
- The Snap renders characters one at a time, without shaping or right-to-left layout. Scripts such as Arabic, Thai, and Hindi are not rendered correctly. CJK text without spaces between words wraps by character count.
Snap views
| Type | Description | Examples of upstream and downstream Snaps |
|---|---|---|
| Input | This Snap has exactly one document input view. | |
| Output | This Snap has exactly one binary output view. | |
| Learn more about Error handling. | ||
Snap settings
- Expression icon (
): Allows using JavaScript syntax to access SnapLogic Expressions to set field values dynamically (if enabled). If disabled, you can provide a static value. Learn more.
- SnapGPT (
): Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.
- Suggestion icon (
): Populates a list of values dynamically based on your Snap configuration. You can select only one attribute at a time using the icon. Type into the field if it supports a comma-separated list of values.
- Upload
: Uploads files. Learn more.
| Field/Field set | Type | Description |
|---|---|---|
| Label* | String | Specify a unique name for the Snap. Modify this to be more appropriate, especially if there are more than one of the same Snap in the pipeline. |
| Font size | String/Expression |
Required.Enter the font size you want in the PDF. Default value: 12 Example: 10 |
| Font | Dropdown list |
Required.Select the font of the PDF. The Snap ignores this field when you specify a Font file. Default value: Times-Roman Example: Helvetica-Oblique |
| Font file | String/Expression |
Specify the location of a TrueType font file (.ttf) to use for all text in the PDF, for example, to render Chinese, Japanese, or Korean text. When you specify a font file, the Snap ignores the Font field. When this field is empty, or its expression evaluates to an empty value, the Snap uses the Font field. The Snap supports the following locations:
The location must end in .ttf and must not contain spaces, a query string, or a fragment, so presigned URLs are not supported. The Snap does not support other schemes, such as https:, s3:, or ftp:. You can use an expression, such as a pipeline parameter. The Snap evaluates the expression once, before it reads any input, so the expression cannot reference fields in the input document. Default value: None Example: /MyOrg/MyProject/NotoSansCJKjp-Regular.ttf |
| Font color | Dropdown list |
Required.Select the font color you want in the PDF. Default value: BLACK Example: GREEN |
| Page size | Dropdown list |
Required.Select the page size you want in the PDF. Default value: A4 Example: LETTER |
| PDF input data | String/Expression |
Select the specific data from the upstream Snaps that you want to be included in the PDF. If left empty, the entire upstream data source is selected. If the expression evaluates to an object or array, the Snap writes it to the PDF as JSON text. Default value: N/A Example: Errors list |
| Snap execution | Dropdown list | Choose one of the three modes in which the Snap executes. Available options
are:
|
Custom font requirements
The Snap does not bundle any fonts. The font file that you specify in the Font file field must meet the following requirements:
- It is a TrueType font file (.ttf) with TrueType outlines. The Snap does not support .otf or .ttc files, or fonts with CFF outlines.
- Its license allows embedding and subsetting. The Snap embeds only the characters that the PDF uses.
- It covers every character in the text, including punctuation and spaces such as the ideographic space (U+3000).
- It is a static font in the Regular weight. The Snap cannot select a weight or style, such as bold or italic. For a variable font, the Snap uses the font's default weight, which can be too light to read comfortably.
The Snap reads the font file each time it runs. A large font file, such as a CJK font of 13 to 36 MB, can add a few seconds to each run. If a parent pipeline runs the Snap once for each record, this time applies to every record.
Troubleshooting
When the Snap fails while it creates the PDF, the error view shows There was an error while formatting the PDF file. as the error and one of the following messages as the reason.
| Error | Reason | Resolution |
|---|---|---|
| U+4F0A ('.notdef') is not available in the font Times-Roman, encoding: WinAnsiEncoding | The input contains characters, such as CJK text, that the standard font in the Font field cannot render. The message can name Helvetica even when you select a different font. | Specify a TrueType font that covers the text in the Font file field, or remove the characters that the selected font cannot render. |
| No glyph for U+0061 (a) in font NotoSansCJKsc-Thin | The font in the Font file field does not cover a character in the input, such as a punctuation mark or a space. | Specify a font that covers all the characters in the text, or remove the characters that the font cannot render. |
| The font file at sldb:///MyOrg/MyProject/font.ttf could not be opened. | The font file does not exist, you do not have access to it, or it is in a different organization. The Snap retries for about 30 seconds before it reports this error. | Verify the location in the Font file field and your access to the file. The file must be in the same organization as the pipeline. |
| The font file at <location> could not be loaded as a TrueType-outline font: This font does not permit subsetting | The font license does not allow subsetting. | Specify a TrueType-outline .ttf font whose license allows embedding and subsetting. |
| The font file at <location> could not be loaded as a TrueType-outline font: True Type fonts using CFF outlines are not supported | The .ttf file contains CFF outlines, for example, an .otf font renamed to .ttf. | |
| The font file at <location> could not be loaded as a TrueType-outline font: <details> | The file is not a valid TrueType font file. |
The following errors occur when you validate or run the pipeline, before the Snap reads any input.
| Error | Reason | Resolution |
|---|---|---|
| The Font file location is invalid. | The location in the Font file field does not end in .ttf, or it contains a query string or fragment, such as a presigned URL. | Specify the location of a file whose name ends in .ttf, without a query string or fragment. The Snap does not support .ttc or .otf files. |
| The Font file location is not supported. | The location uses a scheme other than SLDB or file:, such as https:, s3:, or ftp:. | Use an SLDB path, such as /organization/project/font.ttf, an SLDB URL, such as sldb:///organization/project/font.ttf, or a file: URL. |
| The Font file value is invalid. | The location contains a space, or the expression references a field in the input document. | Rename the font file so that its name has no spaces, or use an expression that does not depend on the input document, such as a pipeline parameter. |