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 31 Mar 2015, 14:15 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
    • S Offline
      S Offline
      sneubert
      wrote on 31 Mar 2015, 14:46 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 31 Mar 2015, 15:11 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
        • S Offline
          S Offline
          sneubert
          wrote on 1 Apr 2015, 06:18 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
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 1 Apr 2015, 23:16 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

            D 1 Reply Last reply 30 Oct 2020, 08:46
            0
            • S SGaist
              1 Apr 2015, 23:16

              Hi,

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

              D Offline
              D Offline
              DrageFabeldyr
              wrote on 30 Oct 2020, 08:46 last edited by
              #6

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

              J 1 Reply Last reply 30 Oct 2020, 08:48
              0
              • D DrageFabeldyr
                30 Oct 2020, 08:46

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

                J Offline
                J Offline
                JonB
                wrote on 30 Oct 2020, 08:48 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 ?

                D 1 Reply Last reply 30 Oct 2020, 09:11
                2
                • J JonB
                  30 Oct 2020, 08:48

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

                  D Offline
                  D Offline
                  DrageFabeldyr
                  wrote on 30 Oct 2020, 09:11 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