Skip to content

Instantly share code, notes, and snippets.

@jbuda
Created March 19, 2013 12:52
Show Gist options
  • Save jbuda/5195846 to your computer and use it in GitHub Desktop.
Save jbuda/5195846 to your computer and use it in GitHub Desktop.
CF loop through PDF and find images
<cfdirectory action="list" directory="#expandPath('/temp')#" name="pdfs" filter="*.pdf" />
<cfoutput query="pdfs">
<cftry>
<cfpdf action="extractimage"
source="#directory#/#name#"
destination="#expandpath('/imgs')#"
format="jpg"
imageprefix="#listFirst(name,'.')#_"
pages="1"
overwrite="yes" />
<cfcatch type="any">
<cfflush>
#name# no image<br/>
</cfcatch>
</cftry>
</cfoutput>
<br/>
images created
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment