[poppler] Printing support in poppler-qt
kkowalczyk at gmail.com
Tue Sep 5 02:05:23 PDT 2006
On 9/5/06, Stefan Kebekus <kebekus at kde.org> wrote:
> 2) the list of links returned by page->links() is always empty.
Page::link() directly calls PDFDoc that returns cached links object
(see PDFDoc::links()). Those links are only generated if
PDFDoc::displayPageSlice() has already been called for that page with
doLinks=true (see PDFDoc::displayPageSlice()). Also, PDFDoc::links()
will only work the first time, since it gives the caller ownership of
the object and doesn't re-generate it.
Most likely Page::link() depends on something that isn't guaranteed.
It's easy to always get your own copy of links. I use this function:
static Links *GetLinksForPage(PDFDoc *doc, int pageNo)
Catalog *catalog = doc->getCatalog();
Page *page = catalog->getPage(pageNo);
Links *links = new Links(page->getAnnots(&obj), catalog->getBaseURI());
so you could probably just replace:
Links *xpdfLinks = data->doc->data->doc.takeLinks();
Links *xpdfLinks = GetLinksForPage(data->doc->data->doc, <the right page no>)
Sumatra - PDF viewer for windows
More information about the poppler