Skip to main content

read_pdf_page_count

Function read_pdf_page_count 

Source
pub fn read_pdf_page_count(path: &Path) -> Option<u32>
Expand description

The page count of a PDF, as pdfTeX’s \pdflastximagepages reports it after \pdfximage: the root /Type /Pages node’s /Count. Without a full parser, the root is the /Pages dictionary with the LARGEST /Count (intermediate nodes count only their subtree); raw bytes first, then the inflated object streams (PDF 1.5+, see read_pdf_page_box). A PDF with no /Pages dictionary at all falls back to counting /Type /Page objects.