[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Possible gb.poppler bug


Hi

I developed a full scale PDFView-Class which I use to display PDF help files resp. documentation within Gambas projects. So far I didn't come across such issue. My PDF test files are V1.5. Can you send me one of the problem PDFs so that I can verify your problem in my project?

Best regards

Claus


Am 29.11.25 um 12:23 schrieb gbWilly:
On Friday, November 28th, 2025 at 14:59, gbWilly <gbWilly@xxxxxxxxxxxxxx> wrote:
While working on a PdfVioewer for Gambos I came across following issue when reading the internal index pages

When and index is read from PdfIndex my code generates a TreeView with the index in it. Next I retrieve the index page so a click in the TreeView will show the page in a DocumentView. All this works fine, expect for some pdf files it creates the index in the TreeView, but returns 0 for each and every page.

I figured out that this returning page 0, doesn't happen for pdf files with format lower that 1.7, they produce a page and I can make a clickable Treeview event to show it. Pdf files in format 1.7 always return page 0, but do build the correct TreeView.

Below debug output in the load index routine I wrote (hPdfIndex is a PdfIndex), returns proper values for Action.Text, Action.Type and Action.Goto.Page IF the format is lower than PDF 1.7:

Debug "Action.Text " & hPdfIndex.Action.Text
Debug "Action.Type " & hPdfIndex.Action.Type
Debug "Action.Goto.Page " & hPdfIndex.Action.Goto.Page

For Pdf files >= PDF 1.7 the Action.Goto.Page ALWAYS returns 0

To retrieve the format, right-click a pdf file and in 'Properties -> Tab Document' you will find this info (at least on a MATE desktop) Atril, the default MATE document viewer does give me a clickable index for PDF 1.7 format files, so the page is definitely available internal, but gb.poppler fails to retrieve it.

My question: Is this a bug in Gambas poppler or does the underlying library simply not support Pdf 1.7 format?

No takers? No one ever created an index for pdf files? Or maybe the issue is unclear? To clarify the issue maybe this screenshot shows you what I mean. You can see all pages returned are 0. This file is screenshot is in PDF 1.7 format If pdf files have lower format version I do get pages returned and they are the correct pages, so I can make the TreeView in the left show a page in the right when clicking in the TreeView.
For the file in the screenshot, that of course doesn't work



Follow-Ups:
Re: Possible gb.poppler buggbWilly <gbWilly@xxxxxxxxxxxxxx>
References:
Possible gb.poppler buggbWilly <gbWilly@xxxxxxxxxxxxxx>
Re: Possible gb.poppler buggbWilly <gbWilly@xxxxxxxxxxxxxx>