Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-119416

Loading a specific page in a PDF document does not always show the correct page

    XMLWordPrintable

Details

    • iOS/tvOS/watchOS, macOS
    • e9a5b6e51 (dev), d63c4dacd (6.7), 7b65afccc (6.6), a98f34f81 (6.5)

    Description

      I try to load a PDF file in a view using Qt Pdf in QML. I use the onStatusChanged signal of the PdfDocument to set the page number on the PdfPageView when the status of the document is PdfDocument.Ready

      It does not work reliably, sometimes it works, and sometimes not. I have the impression that the page needs to be fully loaded, because using a button, i can always change the page, but not programmatically. I already tried to do it in the view when it turns to "visible", or with a Timer, but that seems all not working in a reliable way.

      I tried it on the example "multipage" but there my code does nothing.

      I tried changing the PdfMultiPageView view in the example to a PdfPageView, and then it sometimes work with the smaller example pdf file when going to page 2.  However, a bigger PDF does not work. I attached a PDF that does not work. Try with page index 7 and it stays on page 0 visually, and the user interface shows page 7(actually 8). If you then press up and down next to the page number on the ui, it catches up visually and then shows the real page 7 in the end. 

      This is what I used:

      onStatusChanged: {
        if(status === PdfDocument.Ready) {
          console.log("Goto page 7")
          view.goToPage(7)
        }
      }

      2311.00430.pdf

      Best regards,

      Tom

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            srutledg Shawn Rutledge
            tomdeblauwe Tom Deblauwe
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: