Link to home
Start Free TrialLog in
Avatar of iphone
iphone

asked on

How to export pdf as image in visual c++

Hi,

I am having problem with my c++ project, i need to add function where it can open PDF file and export it as image (jpg,png) without having to display it on the screen.
I try to search around for the DLL to render PDF file but couldnt find any, does anyone know what should i do?



Best regards
Avatar of rajeev_devin
rajeev_devin

Avatar of iphone

ASKER

nice one, but its quite expensive.. (usd 299)
anyone know cheaper one? preferably free because the project is non-profit ;(



Avatar of jkr
Does it have to be an image or would reading the contained text be sufficiant? If so, check out http://www.codeproject.com/cpp/ExtractPDFText.asp ("Code to extract plain text from a PDF file")
Try to call the ImageMagick's (http://www.imagemagick.org/) utility convert or to use the core library programmatically to do the same. I guess that ImageMagick uses the libraries from GhostScript (http://www.cs.wisc.edu/~ghost/) to work with PDF.

I usually use only the convert utility to convert png or tiff images into PDF, but the opposite direction (from PDF to raster images) is said to be also supported. If the convert utility works, you should be able to use the core libraries to do the same. As far as I know, the ImageMagick is available with GPL compatible license and the GhostScript also with the Activestate Free Public License (AFPL).
Well, I tried the "convert something.pdf something.png" and it created the something-0.png and something-1.png, because the something.pdf contained two pages. You can get the sources at http://www.imagemagick.org/script/install-source.php#windows or http://www.imagemagick.org/script/install-source.php#unix.
Avatar of iphone

ASKER

I need to have imagemagick installed to use it.
Im looking for something like DLL actually, so i can integrate it with my application and the user dont have to go through the problem of installing image magick
There are both static and DLL versions of the ImageMagick precompiled binaries -- see http://www.imagemagick.org/script/binary-releases.php#windows. The DLL version contains the core DLL and some DLL related to image formats. I is likely you could create some customized minimal instalation. The versions can also be compiled from the sources that you can also get. It means that, technically, you can statically or dynamically link it to your specific application (you should check the license).

There is also the server  http://www.imagemagick.org/discourse-server/ to help solving various problems related to ImageMagick. Ask there.
Avatar of iphone

ASKER

hmm.. it requires ghostscript to be able to work with pdf..
i found some dll that i want but they are too expensive:
http://www.foxitsoftware.com/pdf/sdk/dll/

and

http://www.pdf-tools.com/asp/products.asp?name=P2IA&gclid=CNX_p_HU7ogCFQOnTAodmhMPiQ

anyone know where can i get the cheaper dll?
Hm, again: Does it have to be an image or would reading the contained text be sufficiant?
Avatar of iphone

ASKER

It has to be image.. the exported image of the pdf pages to be exact
ASKER CERTIFIED SOLUTION
Avatar of pepr
pepr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of iphone

ASKER

the ghostscript need installation, thats the problem..
however i have found a cracked dll to solve my problem..
thanks alots for helpingme anyway

cheers