dump_files
List file attachments as JSON
Usage
pdftl
<input>dump_files[output<output>]
Details
The dump_files operation lists files attached to the input PDF as JSON.
Each attachment is an object with the following fields (all optional except
key and filename):
Field |
Description |
|---|---|
|
Internal NameTree key (may differ from |
|
Attachment filename as stored in the filespec |
|
Human-readable description, if present |
|
MIME type (e.g. |
|
Relationship type (e.g. |
|
Uncompressed file size in bytes |
|
Size as stored in PDF (compressed), in bytes |
|
PDF filter name (e.g. |
|
Creation date in PDF date format |
|
Modification date in PDF date format |
|
List of pages this attachment is attached to |
Note: document-level attachments are attachments which are not attached to any pages.
In this case, the pages field is absent.
Examples
List all files attached to a.pdf as JSON
pdftl a.pdf dump_files
List attachments larger than 1MB
pdftl a.pdf dump_files | jq '.[] | select(.file_size > 1000000)'
List just the filenames of all attachments
pdftl a.pdf dump_files | jq '.[].filename'
Tags: attachments, info
Source: pdftl.operations.attachments
Read online: https://pdftl.readthedocs.io/en/latest/operations/dump_files.html
Type: Operation