<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - PDF links -> SVG"
href="https://bugs.freedesktop.org/show_bug.cgi?id=75953#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - PDF links -> SVG"
href="https://bugs.freedesktop.org/show_bug.cgi?id=75953">bug 75953</a>
from <span class="vcard"><a class="email" href="mailto:rdtennent@gmail.com" title="rdtennent@gmail.com">rdtennent@gmail.com</a>
</span></b>
<pre>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);
}</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>