[poppler] Re: [PATCH] poppler-qt links

Wilfried Huss Wilfried.Huss at gmx.at
Thu Sep 7 14:10:04 PDT 2006


Am Thursday, 7. September 2006 11:48 schrieb Brad Hards:
> On Thursday 07 September 2006 19:07, Wilfried Huss wrote:
> > Hi,
> >
> > attached are two patches (for the qt3 and qt4 bindings) which change
> > Page::links() in a way to make it work correctly even if the render
> > function was not called with doLinks=true previously. The current code
> > results in a crash in such a situation.
> I'm not sure I fully understand this code, but it looks like you are 
> recalculating the links every time.

> Have you timed this?

No I havn't. With the current code, if you want to access link information,
you also need to call renderToImage() first, which is definitely not a cheap
operation.

> Is it worth trying to cache it?

One could try to remember if the last time renderToImage() had been called
with doLinks=true, and then use the cached version of the link data structure.
But I'm not sure if it is really worth it.

Any viewer application will most likely cache data itself. So I don't think that
the usecase where Page::links() will be called so many times in a row, that it
will make a noticable difference, will be very common.

> Also, would it be possible to add a test case that shows the problem you are 
> fixing?

Im mainly trying to fix the problem that it is currently impossible to use the 
Qt-bindings to access the links without first creating a pixmap that has the link
rectangles drawn into it.

kviewshell draws links itself, in order to make the look consistent for all supported
fileformats, and to make things like mouseover effects possible. Therefore I don't
want to have link rectangles painted into the rendered pixmaps.

Greetings,
Wilfried.


More information about the poppler mailing list