Multivalent Tools: PDF Info

## Info

Display various information about a PDF document: title, author, page count, page size, metadata.

### Options

> `java tool.pdf.Info [options] PDF-file...`

- -general -- display general metadata. Default.
- -image -- display image metadata
- -anno -- display annotations
- -font -- display fonts. The columns refer to the font name, type, encoding, embedded or not, subset character set or not, has `/ToUnicode` mapping or not, and object number. With -verbose, also reports number of glyphs in embedded fonts and the pages on which that font is used. Note that sometimes a PDF has duplicate embedded fonts with different subsets.
- -label -- label each line with the PDF file name. This is useful for displaying info on lots of PDFs and filtering out interesting features, which can be tracked back to the source PDF given in the label. For instance, if you wanted to see which of your PDFs were protected with weak encryption, you could type, under UNIX, `java tool.pdf.Info -label . | grep 'Encrypted.*40'`. Or if you wanted to make sure all encrypted PDFs in some collection to be published were restricted against printing, `java tool.pdf.Info -label . | grep restrictions | grep -v print`.
- -verbose -- report additional information, depending on information category
- -password password -- password if PDF is encrypted

### Examples

1. Show general and font info.

    % java tool.pdf.Info -general -font bullet.pdf

produces

    Filename: bullet.pdf
    Title: Microsoft PowerPoint - research.ppt
    Author: wilensky
    Creator: ADOBEPS4.DRV Version 4.50
    Producer: Acrobat Distiller 5.0.5 (Windows)
    Created: Fri Nov 01 11:28:23 PST 2002
    Page count: 1
    PDF version: 1.3
    metadata
    Linearized: version 1
    <?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d' bytes='1094'?><rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'><rdf:Description about='' xmlns='http://ns.adobe.com/pdf/1.3/' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:CreationDate='2002-11-01T19:28:23Z' pdf:ModDate='2002-11-01T19:28:23Z' pdf:Producer='Acrobat Distiller 5.0.5 (Windows)' pdf:Author='wilensky' pdf:Creator='ADOBEPS4.DRV Version 4.50' pdf:Title='Microsoft PowerPoint - research.ppt'/>
    <rdf:Description about='' xmlns='http://ns.adobe.com/xap/1.0/' xmlns:xap='http://ns.adobe.com/xap/1.0/' xap:CreateDate='2002-11-01T19:28:23Z' xap:ModifyDate='2002-11-01T19:28:23Z' xap:Author='wilensky' xap:MetadataDate='2002-11-01T19:28:23Z'><xap:Title><rdf:Alt><rdf:li xml:lang='x-default'>Microsoft PowerPoint - research.ppt</rdf:li></rdf:Alt></xap:Title></rdf:Description>
    <rdf:Description about='' xmlns='http://purl.org/dc/elements/1.1/' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:creator='wilensky' dc:title='Microsoft PowerPoint - research.ppt'/>
    </rdf:RDF><?xpacket end='r'?>

    FONT NAME                        TYPE          ENCODING      EMB SUB UNI   OBJ#
    ComicSansMS                      TrueType      WinAnsi        Y   Y   N      10
    ZapfDingbats                     Type1         <custom>      --core 14--     15

2. Find all PDFs with weak (40-bit) encryption.

    % java tool.pdf.Info -label *.pdf | grep 'Encrypt.*40'

produces

    .../test/pdf/EyesWideShut.pdf: Encrypted: filter Standard (revision 2), 40-bit key, null password
    .../test/pdf/ManningJDK14.pdf: Encrypted: filter Standard (revision 2), 40-bit key, null password
    .../test/pdf/macos_x_intro_english.pdf: Encrypted: filter Standard (revision 2), 40-bit key, null password
    .../test/pdf/siu-bluesheet 2003_08_01.pdf: Encrypted: filter Standard (revision 2), 40-bit key, null password
    .../test/pdf/uskoubriti82802ind.pdf: Encrypted: filter Standard (revision 2), 40-bit key, null password