From 832d792e4e88b85f4926e1241870de4d6ec2d772 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Tue, 9 Feb 2021 15:30:56 -0500 Subject: Add CLI support for working with attachments --- manual/qpdf-manual.xml | 182 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 182 insertions(+) (limited to 'manual') diff --git a/manual/qpdf-manual.xml b/manual/qpdf-manual.xml index 174883a7..5205028d 100644 --- a/manual/qpdf-manual.xml +++ b/manual/qpdf-manual.xml @@ -1801,6 +1801,181 @@ outfile.pdf + + Embedded Files/Attachments Options + + Starting with qpdf 10.2, you can work with file attachments in PDF + files from the command line. The following options are available: + + + + + + Show the “key” and stream number for embedded + files. With , additional + information, including preferred file name, description, + dates, and more are also displayed. The key is usually but not + always equal to the file name, and is needed by some of the + other options. + + + + + + + + Write the contents of the specified attachment to standard + output as binary data. The key should match one of the keys + shown by . If specified + multiple times, only the last attachment will be shown. + + + + + + + + Add or replace an attachment with the contents of + file. This may be specified more + than once. The following additional options may appear before + the -- that ends this option: + + + + + + The key to use to register the attachment in the embedded + files table. Defaults to the last path element of + file. + + + + + + + + The file name to be used for the attachment. This is what is usually + displayed to the user and is the name most graphical PDF + viewers will use when saving a file. It defaults to the + last path element of file. + + + + + + + + The attachment's creation date in PDF format; defaults to + the current time. The date format is explained below. + + + + + + + + The attachment's modification date in PDF format; defaults + to the current time. The date format is explained below. + + + + + + + + The mime type for the attachment, e.g. + text/plain or + application/pdf. Note that the mimetype + appears in a field called /Subtype in + the PDF but actually includes the full type and subtype of + the mime type. + + + + + + + + Descriptive text for the attachment, displayed by some PDF + viewers. + + + + + + + + Indicates that any existing attachment with the same key + should be replaced by the new attachment. Otherwise, + qpdf gives an error if an attachment + with that key is already present. + + + + + + + + + + + + Remove the specified attachment. This doesn't only remove the + attachment from the embedded files table but also clears out + the file specification. That means that any potential internal + links to the attachment will be broken. This option may be + specified multiple times. Run with + to see status of the removal. + + + + + + + + Copy attachments from another file. This may be specified more + than once. The following additional options may appear before + the -- that ends this option: + + + + + + If required, the password needed to open + file + + + + + + + + Only required if the file from which attachments are being + copied has attachments with keys that conflict with + attachments already in the file. In this case, the + specified prefix will be prepended to each key. This + affects only the key in the embedded files table, not the + file name. The PDF specification doesn't preclude multiple + attachments having the same file name. + + + + + + + + + When a date is required, the date should conform to the PDF date + format specification, which is + D:yyyymmddhhmmss<z>, + where <z> is either + Z for UTC or a timezone offset in the form + -hh'mm' or + +hh'mm'. Examples: + D:20210207161528-05'00', + D:20210207211528Z. + + Advanced Parsing Options @@ -4911,6 +5086,13 @@ print "\n"; CLI Enhancements + + + Add new command line options for listing, saving, adding, + removing, and and copying file attachments. See for details. + + The option -- cgit v1.2.3-54-g00ecf