Skip to content

Instantly share code, notes, and snippets.

@JasPanesar
Created August 23, 2012 15:39
Show Gist options
  • Save JasPanesar/3437827 to your computer and use it in GitHub Desktop.
Save JasPanesar/3437827 to your computer and use it in GitHub Desktop.
How to retrieve total page count from a PDF in CFML or CFSCRIPT
Using CFSCRIPT
pdfService = new pdf();
pdfService.setSource( expandpath( './#mypdf#.pdf' ) );
PDFInfo = pdfService.getPdfInfo( name = "pdfinfo" );
pageCount = PDFInfo.TotalPages;
From: http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_p-q_02.html
CFML:
<cfpdf action = "getInfo" source = "#mypdf#.pdf" name = "PDFInfo" >
<cfset pageCount = "#PDFInfo.TotalPages#" >
From: http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSe9cbe5cf462523a0693d5dae123bcd28f6d-7ffd.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment