Qt 5.x: How to render PDF from QByteArray to QPainter?

  • Hi everyone!

    I have a problem with read PDF file. I've used google to find some solution of my problem and I found only some libraries for example "poppler":http://poppler.freedesktop.org. But I can't build this library for Mac OS X 10.8.4 (my application must works on MS Window, Linux and Mac OS X).

    So, the problem which I want to resolve looks like: I have a SQLite DB with BLOB field, it's saves the PDF's data. This DB storage as local not on the server. My application must read the datas from BLOB field of DB and show it in application thats all. I can't find any solution to resolve my problem. Is exist some way to render PDF from QByteArray to QPainter component? Thanks for the any help!

    P.S. I use Qt 5.1 RC1 with QtQuick Desktop Components. The PDF render will use the QtQuick plugin. So I glad to use any solutions for Qt+C++.
    P.S.S. Also I don't want to use third-party libraries because I need cross-platform application.

  • I'm afraid you'll have a huge pile of work to do if you want to render a PDF without third-party libraries. The PDF definition is very complex and making a renderer from scratch is a multi-year, full-time job.

    My suggestion is to get poppler to compile for the targets you need. If you have difficulties for a specific platform, try contacting the poppler community (forum, mailing list,...)

  • Thank for the reply! I will try to compile the poppler. If you find the some way to resolve this problem let me known.

Log in to reply