LinuxCommandLibrary

pdffonts

List fonts used in a PDF file

TLDR

Print PDF file fonts information

$ pdffonts [path/to/file.pdf]
copy

Specify user password for PDF file to bypass security restrictions
$ pdffonts -upw [password] [path/to/file.pdf]
copy

Specify owner password for PDF file to bypass security restrictions
$ pdffonts -opw [password] [path/to/file.pdf]
copy

Print additional information on location of the font that will be used when the PDF file is rasterized
$ pdffonts -loc [path/to/file.pdf]
copy

Print additional information on location of the font that will be used when the PDF file is converted to PostScript
$ pdffonts -locPS [path/to/file.pdf]
copy

SYNOPSIS

pdffonts [options] PDF-file

PARAMETERS

-f number
    Specifies the first page to examine for fonts.

-l number
    Specifies the last page to examine for fonts.

-opw password
    Provides the owner password for encrypted PDF files.

-upw password
    Provides the user password for encrypted PDF files.

-enc encoding
    Sets the output text encoding. Common values include UTF-8, Latin1, ASCII7.

-v
    Displays the copyright and version information for pdffonts.

-h
    Displays a summary of command-line options and usage.

DESCRIPTION

pdffonts is a command-line utility that inspects PDF (Portable Document Format) files to report information about the fonts used within them. It is part of the Poppler PDF rendering library, which is a widely used open-source successor to the Xpdf project.
The command provides a detailed list for each font encountered, including its name, type (e.g., Type 1, TrueType, Type 3, CID), encoding, whether it is embedded directly into the document, if it's a subset of a larger font, and whether it is actually used for rendering text.
This tool is invaluable for document professionals, developers, and system administrators who need to debug font-related issues, verify font embedding compliance, or simply understand the typographic composition of a PDF document. It helps identify missing fonts, incorrect font subsets, or un-embedded fonts that might cause display or printing problems on different systems.

CAVEATS

Incomplete Font Information: pdffonts relies on the font dictionaries embedded in the PDF. If these are malformed or incomplete, the output may not be entirely accurate or complete.
No Rendering: This tool only inspects the font information within the PDF structure; it does not perform any font rendering itself. Therefore, it cannot detect issues related to font rendering engines or system-level font availability beyond what's specified in the PDF.
Encrypted Files: Requires appropriate passwords (-opw or -upw) to access font information in encrypted PDF documents.

OUTPUT COLUMNS

The output typically includes columns like name, type, encoding, embedded, subset, and used.
name: The font name as referenced in the PDF.
type: The font type (e.g., Type 1, TrueType, Type 3, CIDType0, etc.).
encoding: The character encoding used for the font.
embedded: 'yes' if the font data is embedded within the PDF, 'no' otherwise.
subset: 'yes' if only a subset of the font is embedded, 'no' if the full font is embedded.
used: 'yes' if the font is actually used for text, 'no' if it's merely declared but not used.

COMMON USE CASES

Pre-press checks: Verify that all necessary fonts are embedded, ensuring consistent printing.
Troubleshooting: Diagnose why a PDF looks different on various systems (e.g., missing or substituted fonts).
Compliance: Check if a PDF adheres to specific archiving standards (e.g., PDF/A requires all fonts to be embedded and not encrypted).

HISTORY

pdffonts originated as part of the Xpdf project, developed by Derek Noonburg. Xpdf was one of the first open-source PDF viewers and toolkits. Later, a fork of Xpdf, named Poppler, was created to facilitate more rapid development and integration into desktop environments like GNOME and KDE. pdffonts has been a staple utility in both Xpdf and Poppler distributions, consistently providing robust font analysis capabilities for PDF documents across various Unix-like operating systems. Its development closely tracks the evolution of the PDF specification and the Poppler library.

SEE ALSO

pdfinfo(1), pdftotext(1), gs(1), fc-list(1)

Copied to clipboard