API classes for PDF to PNG on linux platform

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
jieleng88

API classes for PDF to PNG on linux platform

Post by jieleng88 »

I am writing a C++ program running on linux and try to use c++ library to convert PDF to PNG. Which class and method should I use for pdf->png conversion? what is the dependency for my program to run?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: API classes for PDF to PNG on linux platform

Post by magick »

To convert PDF to PNG you simple need read() and write(). Read the PDF format, and write the PNG format. Write your Magick++ application and build like this:
  • g++ `Magick++-config --cxxflags --cppflags` -o magick++ magick++.cpp `Magick++-config --ldflags --libs`
jieleng88

Re: API classes for PDF to PNG on linux platform

Post by jieleng88 »

ok. Sounds simple. So there is no third party tool dependency like Ghostscript. Magick++ is the only library my program need to compile and link?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: API classes for PDF to PNG on linux platform

Post by magick »

ImageMagick depends on the Ghostscript delegate library or the gs command line program to interpret PDF. ImageMagick does not rely to either to write a PDF image.
Post Reply