Rasterises a 1-based page of a PDF into an ordinary image object, so the whole image* family (resize, crop, watermark, write in any format) applies to the result. width wins if given; otherwise dpi is used (PDF's native resolution is 72dpi, so dpi/72 is the scale); otherwise 1:1. The output canvas is capped at 40 megapixels regardless of what the page declares — if exceeded, the scale is reduced to fit rather than the call failing.
pdfToImage(pdfObj [, page [, width [, dpi]]])
→ returns any
1Rasterise the first page and write it to disk.
doc = PdfRead( expandPath( "/invoice.pdf" ) );
img = PdfToImage( doc, 1, 400 );
imageWrite( img, expandPath( "/thumb.png" ) );
Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.