Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What C++ library can I use to convert a PDF to an image on windows?

Tags:

c++

windows

pdf

I am working on a project in which I need to analyze images; the primary source of these images is the webcam, but recently we've been ask to add support for uploaded files and scanners. This is fine, for the most part, except they'd like us to be able to use documents in PDF format.

I need a raw pixel bitmap for the processing; on Mac, I can use CoreGraphics to load the PDF into an image buffer, but I'm not sure how to pull this off on Windows.

To summarize: I need a C++ library (preferably with a license like BSD since this is closed-source, but potentially LGPL could work) that I can use to open a PDF file and export each page as a rendered image buffer bitmap.

like image 365
taxilian Avatar asked Jul 06 '11 22:07

taxilian


2 Answers

ImageMagick. Far and away the best library for reading and writing as many formats as possible http://www.imagemagick.org/script/index.php

like image 178
totowtwo Avatar answered Sep 24 '22 03:09

totowtwo


  • With swftools http://wiki.swftools.org/

Example:

pdf2swf --pages 1 -T9 PDF_FILE.pdf -o temp.swf
swfrender temp.swf --output 1.png
  • With poppler

Example using Qt http://bit.ly/8UksK6

like image 41
Rodrigo Avatar answered Sep 24 '22 03:09

Rodrigo