pdfRead

Reads a PDF file (by path or as a Binary) into a shared, reference-typed PDF object. The parsed document is a native object: passing it around costs nothing and every handle sees the same document. Throws a runtime error if the file is not a PDF, is truncated, or uses an encryption the engine cannot open.

pdfRead(pathOrBinary) → returns any

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

Argument Reference

pathOrBinary any
Required

Absolute path to a PDF file, or a Binary containing the PDF bytes.

Examples
Sample code invoking the pdfRead function

Open a PDF and inspect its metadata.

doc  = PdfRead( expandPath( "/invoice.pdf" ) );
info = PdfInfo( doc );
writeDump( info );

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

Fork me on GitHub