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

Re: Possible gb.poppler bug


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.TextAction.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

IndexWithoutPages.png

On Gambas One forum, some have been testing this as well.
Seems that some PDf 1.6 format files do give a page, some don't.
Lower than PDF 1.6 format, so far always returned the proper page, PDF 1.7 never gives the page (always 0).

Maybe the author of gb.poppler could shed a light on the matter?

gbWilly


...there is always a Catch if things go wrong!


Sent with Proton Mail secure email.

Follow-Ups:
Re: Possible gb.poppler bugBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: Possible gb.poppler bugClaus Dietrich <claus.dietrich@xxxxxxxxxx>
References:
Possible gb.poppler buggbWilly <gbWilly@xxxxxxxxxxxxxx>