PDA

View Full Version : pdf document to bmp image



sanjeet
14th March 2013, 06:48
Hi,

I have to convert pdf document(small document of 1 page) to bmp image in my Qt Application on Linux.

can you guide me...... how to do that ?

Is it possible to convert pdf document in bmp images ?

thanks in advance

d_stranz
14th March 2013, 18:17
Is it possible to convert pdf document in bmp images ?


Not with Qt itself. You can convert a PDF document to a QImage using Poppler-Qt4 (http://people.freedesktop.org/~aacid/docs/qt4/). Once you have a QImage, you can save that to whatever format QImage supports.

Poppler-Qt4 is just a Qt wrapper for poppler (http://poppler.freedesktop.org/) itself, which you will also have to download and build. I think poppler is only available on linux platforms.

sanjeet
15th March 2013, 11:10
hi d_stranz

first of all thanks to you.

i am already trying with Poppler-Qt4, and i have already installed Poppler-Qt4.

But i am not able to convert PDF document in QImage. If it is possible then my work is over.
can you provide me any link for this or demo source for converting pdf to QImage.

d_stranz
15th March 2013, 20:27
But i am not able to convert PDF document in QImage. If it is possible then my work is over.
can you provide me any link for this or demo source for converting pdf to QImage.

Did you actually look at this page? (http://people.freedesktop.org/~aacid/docs/qt4/) It contains all the code you need to open a PDF document, go to a specific page, then render that page to a QImage using Poppler-Qt4.

If you want to render a multi-page document to a single QImage, then you need to divide your QImage up into page-sized rectangles, set the x, y and call renderToImage() for each page.

peterlee
26th September 2015, 10:52
Hi, Sanjeet.
I wonder have you ever worked it out? Do I need another 3rd party manual toolkit? When it comes to PDF converting process, I have another question, I wonder have you ever tried to convert pdf to other image files (http://www.pqscan.com/pdf-to-image/) before? As for myself, I am testing the related PDF to PNG converting, PDF to BMP converting (http://www.pqscan.com/convert-pdf/to-bmp-csharp.html) , and PDF to JPG converting programs these days. Do you have experience about it? Any suggestion will be appreciated. Thanks in advance.



Best regards,
Peter

ChrisW67
26th September 2015, 22:31
All the tools you need are mentioned in this thread already. Once you have a QImage you can save it in a range of formats.