[poppler] How to know page number for links w/o loading pages?
Leonard Rosenthol
lrosenth at adobe.com
Sun Jan 18 08:12:20 PST 2009
Depends on what’s in the link.
A Link is just a UI element that holds either an Action or a Destination.
In the case of a destination, that can be either an indirect reference to the Page object OR it can be a string (named destination) that points into the Name tree off the Catalog. In neither case would it be a simple page #.
Actions are more complex because there are over a dozen pre-defined action types plus there can be “custom ones”. For the standard actions, a GoTo action would take you to another page of the same document by basically wrapping up a Destination (see above). It could also be a JavaScript action with a “this.pageNum=X”, where X is the page number to go to. Now Poppler doesn’t currently support JS actions, but just being complete.
Leonard
On 1/18/09 3:34 PM, "Тодор Африкански" <afrikanski at gmail.com> wrote:
Hello,
I've tweaked poppler a little bit, so it won't load all the pages when the document is created, but when they are actually needed (btw if I submit this kind of patch will it be accepted, there are no major changes?). That's because I need to load large files from the web, so I load the files in chunks when data is actually needed. The problem is with links. The function that finds a page from its object number just compares all pages, assuming they are already loaded. Is there a way to know the page number the link leads to without the target page actually being loaded?
Thank you,
Tosho
--
Leonard Rosenthol
PDF Standards Architect
Adobe Systems Incorporated
More information about the poppler
mailing list