Attach File (Embedded File)
attach_fileEmbed supporting files, such as CSV or XML data, into a PDF to create PDF/A-3 compliant bundles for e-bookkeeping and archival workflows.
Instructions
Embed (attach) a file into a PDF. Registers it under /Names /EmbeddedFiles and the catalog /AF, with an AFRelationship. For PDF/A-3 (ISO 19005-3) and Japanese e-bookkeeping-law (電子帳簿保存法) workflows that bundle "a human-readable invoice PDF + machine-readable data (CSV/XML)" into one file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Display name inside the PDF. Defaults to the original filename. Must not duplicate an existing attachment. | |
| mimeType | No | MIME type. Inferred from the extension when omitted (e.g. .csv → text/csv). | |
| inputPath | Yes | Absolute path of the target PDF. | |
| outputPath | No | Destination file path (absolute). When omitted, a base64 string is returned instead. | |
| description | No | Description of the attachment (/Desc; CJK fine). | |
| relationship | No | Relation to the document content (PDF/A-3 §6.8). Data = machine-readable data with the same content as the document (invoice XML/CSV etc.) / Source = the source data of the document / Alternative = an alternative representation / Supplement = supplementary material / Unspecified = unknown (default). PDF/A-3 requires a meaningful value, so omission warns. | |
| returnBase64 | No | When true, include a base64 string in the result in addition to saving. | |
| attachmentPath | Yes | Absolute path of the file to embed. | |
| preserveSignatures | No | Edit a signed PDF via an incremental update (appending) without invalidating existing signatures. Default false. The original bytes are untouched, so /ByteRange holds. Changes beyond the certification (DocMDP) permission level are refused. | |
| allowBreakingSignatures | No | When the target is digitally signed (detected via /ByteRange), the default is an error. Set true to proceed, accepting that the signatures become invalid. |