11.2 Reading Document Information

The -info option prints entries from the document information dictionary to standard output.

$cpdf -info pdf_reference.pdf  
Encryption: 40bit  
Linearized: true  
Permissions: No edit  
Version: 1.6  
Pages: 1310  
Title: PDF Reference, version 1.7  
Author: Adobe Systems Incorporated  
Subject: Adobe Portable Document Format (PDF)  
Keywords:  
Creator: FrameMaker 7.2  
Producer: Acrobat Distiller 7.0.5 (Windows)  
Created: D:20061017081020Z  
Modified: D:20061118211043-02'30'

The details of the format for creation and modification dates can be found in Appendix A.

By default, cpdf strips to ASCII, discarding character codes in excess of 127. In order to preserve the original unicode, sdd the -utf8 option. To disable all postprocessing of the string, add -raw.

The -page-info option prints the media box and other boxes page-by-page to standard output:

$cpdf -page-info 14psfonts.pdf  
Page 1:  
MediaBox: 0.000000 0.000000 600.000000 450.000000  
CropBox: 200.000000 200.000000 500.000000 500.000000  
BleedBox:  
TrimBox:  
ArtBox:  
Rotation: 0

Note that the format for boxes is minimum x, minimum y, maximum x, maximum y.

The -pages operation prints the number of pages in the file.

$cpdf -pages Archos.pdf  
8