Introduction

This chapter explains how to retrieve basic information about a PDF document. The information is similar to that found with Adobe Acrobat’s Document Properties feature with some added statistics.

You will learn how to:

Obtaining an Overall Snapshot of the Document

To obtain a summary of information about a PDF document, submit the apgetinfo command with the document’s file name and the -summary option. You will receive a listing that includes information about the following:

  • Document description
  • Bookmarks
  • Annotations
  • Fonts

Command

$apgetinfo -summary pathname\ApUtilsSample.pdf

Tip! The -summary option is the default, so you don’t have to include it.

Windows Example

$apgetinfo C:\Appligent\APGetInfo\samples\ApUtilsSample.pdf

UNIX/Macintosh Example

$./apgetinfo /Appligent/APGetInfo/samples/ApUtilsSample.pdf

Result

The figure below shows the results of running apgetinfo with no options (or with the -summary option) on the ApUtilsSample.pdf file in a default Windows installation.

Summary Information reported

Retrieving Document Description Information

To see document description information for a PDF file, use the -info option when you submit the apgetinfo command. Document description information includes data that identifies a file, such as its title and creation date. In Adobe Acrobat and Adobe Reader, most of this information can be viewed on the Description panel of the Document Properties dialog box.

Command

$apgetinfo -info inPDFFile

Windows Example

$apgetinfo -info C:\Appligent\APGetInfo\samples\ApUtilsSample.pdf

UNIX/Macintosh Example

$./apgetinfo -info /Appligent/APGetInfo/samples/ApUtilsSample.pdf

Result

The figure below shows the results of running apgetinfo with the -info option on the ApUtilsSample.pdf file. The order of information (Title, Creator, Author, etc.) may vary from document to document, depending on how it was created.

Info Option results

Getting Font Information

To get information about the fonts in a PDF document, use the -font option with the apgetinfo command. The information displayed includes:

  • The names of each font used in the document
  • The font type (for example, Type 1, Base 14)
  • Whether or not the font is embedded in the document

Command

$apgetinfo -font inPDFFile

Windows Example

$apgetinfo -font C:\Appligent\APGetInfo\samples\ApUtilsSample.pdf

UNIX/Macintosh Example

$./apgetinfo -font /Appligent/APGetInfo/samples/ApUtilsSample.pdf

Result

The figure below shows the results of running apgetinfo with the -font option on the ApUtilsSample.pdf file.

Font option information

Getting Multiple Types of Document Information

You can list multiple types of document information by using a combination of options.

Command

$apgetinfo [document information options] inPDFFile

Windows Example

$apgetinfo -info -font C:\Appligent\APGetInfo\samples\ApUtilsSample.pdf

UNIX/Macintosh Example

$./apgetinfo -info -font /Appligent/APGetInfo/samples/ApUtilsSample.pdf

Result

The figure below shows the results of running apgetinfo with the -info and -font options on the ApUtilsSample.pdf file.

Results from Font and Info Options