Skip to contents

Returns one tibble row per distinct font used anywhere in the document, with the same metadata columns pdf_text_runs()/pdf_text_font() report at the run/object level. Useful for porting from pdftools::pdf_doc_fonts().

Usage

pdf_doc_fonts(doc, password = NULL)

Arguments

doc

A pdfium_doc from pdf_doc_open(), or a character path.

password

Optional password for encrypted PDFs when doc is a path. Ignored when doc is already an open pdfium_doc.

Value

A tibble with columns: font_base_name, font_family, font_weight, font_italic_angle, font_is_embedded, font_flags, first_seen_page (1-based).

Details

Two fonts are treated as distinct when any of font_base_name, font_family, font_weight, font_italic_angle, font_is_embedded, or font_flags differ. The first page on which each font appears is recorded in first_seen_page.