Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to display pages with poppler
QtWS25 Last Chance

How to display pages with poppler

Scheduled Pinned Locked Moved General and Desktop
pdfpopplerqt5
8 Posts 5 Posters 2.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    chronix
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • sneubertS Offline
      sneubertS Offline
      sneubert
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        chronix
        wrote on last edited by chronix
        #3

        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.

        1 Reply Last reply
        0
        • sneubertS Offline
          sneubertS Offline
          sneubert
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi,

            Isn't that article from Qt Quarterly what you are looking for ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            DrageFabeldyrD 1 Reply Last reply
            0
            • SGaistS SGaist

              Hi,

              Isn't that article from Qt Quarterly what you are looking for ?

              DrageFabeldyrD Offline
              DrageFabeldyrD Offline
              DrageFabeldyr
              wrote on last edited by
              #6

              the same question
              @SGaist link in dead for now, may be you have another example

              JonBJ 1 Reply Last reply
              0
              • DrageFabeldyrD DrageFabeldyr

                the same question
                @SGaist link in dead for now, may be you have another example

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by JonB
                #7

                @DrageFabeldyr
                Not very hard to find the old page: https://doc.qt.io/archives/qq/qq27-poppler.html

                EDIT 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 ?

                DrageFabeldyrD 1 Reply Last reply
                2
                • JonBJ JonB

                  @DrageFabeldyr
                  Not very hard to find the old page: https://doc.qt.io/archives/qq/qq27-poppler.html

                  EDIT 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 ?

                  DrageFabeldyrD Offline
                  DrageFabeldyrD Offline
                  DrageFabeldyr
                  wrote on last edited by DrageFabeldyr
                  #8

                  @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

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved