Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5.3, 6.6.0
-
-
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) } }
Best regards,
Tom