How to convert PDF to Jpg?



  • I ve done the reverse. by panting QPrinter Object with QImage..and saving it as Pdf.
    But dont understand how to how convert the reverse?
    Please share any codes/idea?


  • Lifetime Qt Champion

    Hi,

    You would need to use a library like poppler to read the PDF. You can only print to pdf with Qt



  • so there is no codes to convert it.thanks in advance.
    [quote author="SGaist" date="1386797868"]Hi,

    You would need to use a library like poppler to read the PDF. You can only print to pdf with Qt[/quote]


  • Lifetime Qt Champion

    Pure Qt code without any external lib ? Not that I know of. However poppler has support for both Qt 4 and 5 so it might help



  • Hello blu-sky..

    I have an idea ...if you can render pdf on QWidget one by one, then in order to convert this pdf you can create a snapshot of QWidget using pixmap.grabWidget();
    and save it to jpg format using pixmap.save() function..

    Hope it'll help you..


  • Moderators

    [quote author="IamSumit" date="1386918834"]
    I have an idea ...if you can render pdf on QWidget one by one, then in order to convert this pdf you can create a snapshot of QWidget using pixmap.grabWidget();[/quote]
    well, that was the question.
    If you can render a PDF to a QPaintDevice (like QWidget and QPixmap is anyway) why shouldn't you render it directly to a pixmap...



  • Hello RW,
    yeah you are right...
    Thanxx..



  • You are right.
    [quote author="raven-worx" date="1386920943"][quote author="IamSumit" date="1386918834"]
    I have an idea ...if you can render pdf on QWidget one by one, then in order to convert this pdf you can create a snapshot of QWidget using pixmap.grabWidget();[/quote]
    well, that was the question.
    If you can render a PDF to a QPaintDevice (like QWidget and QPixmap is anyway) why shouldn't you render it directly to a pixmap...

    [/quote]



  • This post is deleted!

  • Banned

    This post is deleted!

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.