Coherent PDF Command Line Tools

User Manual
Version 2.8 (December 2024)

Coherent Graphics Ltd logo

Coherent Graphics Ltd

For bug reports, feature requests and comments, email
contact@coherentgraphics.co.uk

© Coherent Graphics Limited. All rights reserved. ISBN 978-0957671140

Adobe, Acrobat, and Adobe PDF are registered trademarks of Adobe Systems Incorporated. Windows, Powerpoint and Excel are registered trademarks of Microsoft Corporation.

Quickstart Examples
Chapter 1: Basic Usage
Chapter 2: Merging and Splitting
Chapter 3: Pages
Chapter 4: Encryption and Decryption
Chapter 5: Compression
Chapter 6: Bookmarks
Chapter 7: Presentations
Chapter 8: Logos, Watermarks and Stamps
Chapter 9: Multipage Facilities
Chapter 10: Annotations
Chapter 11: Document Information and Metadata
Chapter 12: File Attachments
Chapter 13: Images
Chapter 14: Fonts
Chapter 15: PDF and JSON
Chapter 16: Optional Content Groups
Chapter 17: Creating New PDFs
Chapter 18: Drawing on PDFs
Chapter 19: Accessible PDFs with PDF/UA
Chapter 20: Miscellaneous
Contents
Typographical Conventions
1 Basic Usage
1.1 Documentation
1.2 Input and Output Files
1.3 Input Ranges
1.4 Working with Encrypted Documents
1.5 Standard Input and Standard Output
1.6 Doing Several Things at Once with AND
1.7 Units
1.8 Setting the Producer and Creator
1.9 PDF Version Numbers
1.10 File IDs
1.11 Linearization
1.12 Object Streams
1.13 Malformed Files
1.14 Error Handling
1.15 Control Files
1.16 String Arguments
1.17 Text Encodings
1.18 Line Endings
2 Merging and Splitting
2.1 Merging
2.2 Splitting
2.3 Splitting on Bookmarks
2.4 Splitting to Maximum Size
2.5 Spraying
2.6 Encrypting with Split operations
2.7 Splitting and structure trees
3 Pages
3.1 Page Sizes
3.2 Scale Pages
3.3 Shift Page Contents
3.4 Rotating Pages
3.5 Flipping Pages
3.6 Boxes and Cropping
3.7 Showing Boxes and Printer’s Marks
4 Encryption and Decryption
4.1 Introduction
4.2 Encrypting a Document
4.3 Decrypting a Document
5 Compression
5.1 Decompressing a Document
5.2 Compressing a Document
5.3 Squeezing a Document
6 Bookmarks
6.1 List Bookmarks
6.2 Remove Bookmarks
6.3 Add Bookmarks
6.4 Opening bookmarks
6.5 Making a Table of Contents
7 Presentations
8 Watermarks and Stamps
8.1 Add a Watermark or Logo
8.2 Stamp Text, Dates and Times.
8.3 Stamping Rectangles
8.4 Low-level facilities
9 Multipage Facilities
9.1 Inserting Blank Pages
9.2 Redaction
9.3 Imposition
9.4 Chopping up pages
10 Annotations
10.1 Listing Annotations
10.2 Setting annotations
10.3 Copying Annotations
10.4 Removing Annotations
11 Document Information and Metadata
11.1 Reading Document Information
11.2 Setting Document Information
11.3 XMP Metadata
11.4 Upon Opening a Document
11.5 Document Language
11.6 Page Labels
11.7 Composition of a PDF
12 File Attachments
12.1 Adding Attachments
12.2 Listing Attachments
12.3 Removing Attachments
12.4 Dumping Attachments to File
13 Images
13.1 Extracting images
13.2 Listing images
13.3 Listing images at point of use
13.4 Removing an Image
13.5 Processing Images
13.6 Rasterization (PDF to image conversion)
14 Fonts
14.1 Listing Fonts
14.2 Listing characters in a font
14.3 Copying Fonts
14.4 Removing Fonts
14.5 Missing Fonts
14.6 Extracting Fonts
15 PDF and JSON
15.1 Converting PDF to JSON
15.2 Converting JSON to PDF
16 Optional Content Groups
17 Creating New PDFs
17.1 A new blank PDF
17.2 Convert a text file to PDF
17.3 Make a PDF from a PNG, JPEG or JPEG2000 image
17.4 Make a PDF from one or more JBIG2 images
18 Drawing on PDFs
18.1 Basics
18.2 Building and showing paths
18.3 Clipping with paths
18.4 Path parameters
18.5 The graphics stack and matrices
18.6 Re-use with XObjects
18.7 Images
18.8 Transparency
18.9 Text
18.10 Paragraphs
18.11 The next page
18.12 Structure information
19 Accessible PDFs with PDF/UA
19.1 Structure trees
19.2 Verifying conformance to PDF/UA
19.3 PDF/UA compliance markers
19.4 Merging and splitting PDF/UA files
19.5 Creating new PDF/UA files
19.6 Drawing PDF/UA files
20 Miscellaneous
20.1 Draft Documents
20.2 Blackening Text, Lines and Fills
20.3 Hairline Removal
20.4 Garbage Collection
20.5 Change PDF Version Number
20.6 Copy ID
20.7 Remove ID
20.8 List Spot Colours
20.9 PDF Dictionary Entries
20.10 Removing Clipping
20.11 Exploring PDFs
A Dates
A.1 PDF Date Format
A.2 XMP Metadata Date Format
B Change logs
B.1 Cpdf Change Log
B.2 CamlPDF Change Log
C Matterhorn Protocol