pdfPageCount

Returns the number of pages in a PDF document.

pdfPageCount(pdfObj) → returns numeric

This function requires RustCFML.  Not supported on Lucee, Adobe ColdFusion, etc.

Argument Reference

pdfObj any
Required

A PDF object from pdfRead() or pdf().

Examples
Sample code invoking the pdfPageCount function

Count the pages in a PDF.

doc = PdfRead( expandPath( "/invoice.pdf" ) );
writeOutput( PdfPageCount( doc ) );

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub