[Poppler-bugs] [Bug 75953] PDF links -> SVG

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Apr 5 09:40:19 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=75953

--- Comment #1 from rdtennent at gmail.com ---
It's easy enough to access the necessary information using
poppler_page_get_link_mapping; but I don't see any way to add xlinks to the svg
surface other than by adding them to the svg file:

    LinkMappings = poppler_page_get_link_mapping (page);
    for (l = LinkMappings; l != NULL; l = l->next)
      {
         PopplerLinkMapping *plm = l->data;
         PopplerRectangle rect = plm->area;
         PopplerAction *act = plm->action;
         if (act->type == POPPLER_ACTION_URI) 
           {
              fprintf ( nsvg, "<a xlink:href=\"%s\" target=\"_blank\">\n",
act->uri.uri);
              fprintf ( nsvg, "<rect fill-opacity=\"0.0\" ");
              fprintf ( nsvg, "x=\"%5.3f\" y=\"%5.3f\" ", rect.x1,
height-rect.y2);
              fprintf ( nsvg,  "width=\"%5.3f\" height=\"%5.3f\"/></a>\n",  
                                 rect.x2-rect.x1, 
                                 rect.y2-rect.y1);   
           }

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler-bugs/attachments/20140405/e0fb99eb/attachment.html>


More information about the Poppler-bugs mailing list