pdftl - PDF tackle 0.25.1.post0.dev0+unreleased.changelog

A wannabe CLI compatible clone/extension of pdftk

Usage

pdftl <input>... <operation> [<option...>]
pdftl <input>... <operation> [<option...>] --- [<input>...] <operation>... [<option...>] ...
pdftl --args <file.yml>
pdftl help [<operation> | <option>]
pdftl help [help | args | sign | filter | input | --- | pages | output | examples | completion | all]
pdftl --completion  (bash | zsh | powershell)
pdftl --version

Operations

add_bookmarks

Add top-level bookmarks

add_images

Stamp user-specified images onto PDF pages

add_text

Add user-specified text strings to PDF pages

attach_files

Attach files to the output PDF

background

Use a 1-page PDF as the background

barcode

Generate and add a barcode to pages

booklet

Impose pages into printable booklet signatures

burst

Split a single PDF into multiple files

cat

Concatenate pages from input PDFs into a new PDF

chop

Chop pages into multiple smaller pieces

clip

Clip page content to a rectangle

create

Create a new PDF

crop

Crop pages to a rectangle

delete

Delete pages from an input PDF

delete_actions

Delete action info

delete_annots

Delete annotation info

delete_attachments

Delete file attachments based on criteria

delete_blank

Delete blank or near-blank pages

delete_bookmarks

Delete bookmarks

delete_images

Delete images

deskew

Automatically detect and correct document skew

diff_text

Diff the text content of two PDFs and output bounding boxes

dump_actions

Dump action info

dump_annots

Dump annotation info

dump_bookmarks

Extract PDF bookmarks into YAML or JSON

dump_colorspaces

Report color spaces used

dump_data

Metadata, page and bookmark info (XML-escaped or JSON)

dump_data_annots

Dump annotation info in pdftk style

dump_data_fields

Print PDF form field data with XML-style escaping

dump_data_fields_utf8

Print PDF form field data in UTF-8

dump_data_utf8

Metadata, page and bookmark info (in UTF-8)

dump_dests

Print named destination data to the console

dump_encryption

Print PDF encryption details and user permissions

dump_files

List file attachments as JSON

dump_fonts

Extract font metadata

dump_images

Extract PDF embedded image metadata to JSON

dump_layers

Dump layer info (JSON)

dump_signatures

List and validate digital signatures

dump_streams

Dump page content streams as seen by replace

dump_tables

Extract tables to JSON, CSV, or Markdown

dump_tags

Inspect the PDF structure tree and reading order

dump_text

Print PDF text data to the console or a file

embed_fonts

Automatically locate and embed missing system fonts

export_fonts

Export fonts and a JSON manifest for external editing

export_images

Export images and a JSON manifest for external editing

fill_form

Fill a PDF form

filter

Do nothing (the default if <operation> is absent)

generate_fdf

Generate an FDF file containing PDF form data

grep

Match text patterns and get bounding boxes

highlight

Highlight text matching a regex pattern

import_fonts

Import edited fonts from a directory using a JSON manifest

import_images

Import edited images from a directory using a JSON manifest

import_streams

Import and apply modified content streams

inject

Inject code at start or end of page content streams

insert

Insert blank pages

modify_annots

Modify properties of existing annotations

modify_images

Apply in-place image pixel modifications and effects

modify_layers

Modify state, merge, or strip specific layers

montage

Impose pages onto a grid layout

move

Move pages to a new location

multibackground

Use multiple pages as backgrounds

multistamp

Stamp multiple pages onto an input PDF

mutate_content

Mutate page content streams using a user-supplied Python script

normalize

Reformat page content streams

optimize_images

Optimize images

place

Shift, scale, and spin page content

recolor_images

Convert images to grayscale

recolor_vectors

Make non-image page content gray

render

Render PDF pages as images or a single rasterized PDF

replace

Regex replacement on page content streams

resample_images

Resample images

rotate

Rotate pages in a PDF

server

Start the pdftl API server

set

Set document properties, viewer preferences, and page labels

shuffle

Interleave pages from multiple input PDFs

simplify_vectors

Reduce vector path complexity

stamp

Stamp a 1-page PDF onto each page

stamp_fields

Stamp PDF content into form fields

style_text

Change appearance of text

tag

Auto-tag a PDF for accessibility using OpenDataLoader

unpack_files

Unpack file attachments

unpause

Remove ‘pause’ frames from a slide deck

update_bookmarks

Replace PDF bookmarks from a YAML or JSON file

update_info

Update PDF metadata from dump_data instructions

update_info_utf8

Update PDF metadata from dump_data_utf8 instructions

zoom

Rescale entire pages

Options

allow <perm>...

Specify permissions for encrypted files

compress

Compress output file streams (default)

drop_info

Discard document-level info metadata

drop_xfa

Discard form XFA data if present

drop_xmp

Discard document-level XMP metadata

encrypt_128bit

Use 128 bit encryption (obsolete and insecure)

encrypt_40bit

Use 40 bit encryption (obsolete, highly insecure)

encrypt_aes128

Use 128 bit AES encryption (default)

encrypt_aes256

Use 256 bit AES encryption

fast

Skip stream recompression for faster saving

flatten

Flatten annotations and form fields

keep_final_id

Copy final input PDF’s ID metadata to output

keep_first_id

Copy first input PDF’s ID metadata to output

linearize

Linearize output file(s)

need_appearances

Set a form rendering flag in the output PDF

no_encrypt_metadata

Leave metadata unencrypted

output <file>

The output file path, or a template for burst

owner_pw <pw>

Set owner password and encrypt output

replacement_font <file>

Replace the font used for all form fields with a TTF file

sign_cert <file>

Path to certificate PEM

sign_field <name>

Signature field name (default: Signature1)

sign_key <file>

Path to private key PEM

sign_pass_env <var>

Environment variable with sign_cert passphrase

sign_pass_prompt

Prompt for sign_cert passphrase

uncompress

Disable compression of output file streams

user_pw <pw>

Set user password and encrypt output

verbose

Turn on verbose output