Add embedded file attachment (PDF/A-3, Factur-X)
add_attachmentEmbed multiple files in PDF/A-3 documents, supporting Factur-X/ZUGFeRD invoices with XML attachments.
Instructions
Generate a PDF/A-3 (ISO 19005-3) document with one or more embedded files. USE THIS INSTEAD OF generate_basic_pdf when you need a Factur-X / ZUGFeRD electronic invoice (single XML payload with relationship='Source'), or any PDF that must carry machine-readable side-files. The visible document body is supplied via the optional blocks parameter (same block schema as generate_basic_pdf). The tool auto-emits PDF/A-3b conformance — PDF/A-3 is the only PDF/A part that legally permits embedded files. Each attachment is capped at 8 MiB.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Document title (also written to the /Info dictionary). | |
| blocks | No | Optional human-readable document body (same block schema as generate_basic_pdf). When omitted, a minimal cover paragraph is emitted so the PDF is not empty. | |
| footerText | No | Optional footer text rendered on every page. | |
| attachments | Yes | One or more files to embed. Auto-enables PDF/A-3 (ISO 19005-3). Factur-X invoices use a single attachment with relationship=Source and mimeType=application/xml. | |
| outputMode | No | base64 | |
| outputPath | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | ||
| sizeBytes | Yes | ||
| filePath | No | Absolute sandboxed file path (when mode='file'). | |
| base64 | No | Base64-encoded PDF bytes (when mode='base64'). |