[poppler] problem with rectangles of links in a pdf

Vincent Torri vtorri at univ-evry.fr
Mon Oct 11 00:13:11 PDT 2010


Hey,

I am trying to display the rectangles of the links of a pdf. Here is what 
i do (basically, it's what the glib frontend does):

/* I loop over the links */
link = links.getLink(i);
link->getRect (&x1, &y1, &x2, &y2);
x1 -= ebp->page.page->getCropBox()->x1;
x2 -= ebp->page.page->getCropBox()->x1;
y1 -= ebp->page.page->getCropBox()->y1;
y2 -= ebp->page.page->getCropBox()->y1;

link_item->rect.x = round(x1);
link_item->rect.y = round(y1);
link_item->rect.w = round(x2 - x1);
link_item->rect.h = round(y2 - y1);

I display these rectangles on the pdf. I have attached the result 
(rectangles are blue) and the pdf.

Does someone see if what I did is wrong ?

thank you

Vincent Torri
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pdf_links.png
Type: image/png
Size: 76129 bytes
Desc: 
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20101011/75c27a44/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: manual.pdf
Type: application/pdf
Size: 184049 bytes
Desc: 
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20101011/75c27a44/attachment-0001.pdf>


More information about the poppler mailing list