How to display pages with poppler
-
wrote on 31 Mar 2015, 14:15 last edited by
I'm trying to make a Document Viewer and i'm kinda stuck. I'm using poppler lib. I can open PDFs, and view a single page(the page number that is passed to poppler page function), by rendering it to Qimage and displaying it using a QLable. How can i display all pages, and how can i make continious view mode?
-
wrote on 31 Mar 2015, 14:46 last edited by
Hi chronix,
you have to implement this by yourselfe.
You can ask the poppler document for the number of pages
the pdf includes and render every page to an image.
Then you need to implement some kind of page switching, like
pressing the right arrow key to display the next page in your label.
Poppler only gives you the ability to render pages or search for text, aso.
You have to build the viewer part arround this. -
wrote on 31 Mar 2015, 15:11 last edited by chronix
Yeah, i understand that, i get the whole concept, but i stuck with the implimentation part. I'll try and figure it out. Thanks for you reply.
-
wrote on 1 Apr 2015, 06:18 last edited by
One approach I made, was to use a QGraphicsView. To display the pages I used QGraphicsPixmapItem. Then I reimplemented the ViewportEvent of the QGraphicsView to move the pages in the QGraphicsPixmapItems on mouse wheel to get a scrolling effect.
-
Hi,
Isn't that article from Qt Quarterly what you are looking for ?
-
wrote on 30 Oct 2020, 08:46 last edited by
the same question
@SGaist link in dead for now, may be you have another example -
the same question
@SGaist link in dead for now, may be you have another examplewrote on 30 Oct 2020, 08:48 last edited by JonB@DrageFabeldyr
Not very hard to find the old page: https://doc.qt.io/archives/qq/qq27-poppler.htmlEDIT BTW, Qt things have changed since 2015. If you want a PDF viewer now, what about https://doc.qt.io/qt-5/qtpdf-pdfviewer-example.html ?
-
@DrageFabeldyr
Not very hard to find the old page: https://doc.qt.io/archives/qq/qq27-poppler.htmlEDIT BTW, Qt things have changed since 2015. If you want a PDF viewer now, what about https://doc.qt.io/qt-5/qtpdf-pdfviewer-example.html ?
wrote on 30 Oct 2020, 09:11 last edited by DrageFabeldyr@JonB oh, sorry, didn't recognized the link, this article i've read already
i work with astra linux, it has poppler and i hope that's enough for my task