<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:philipp.reinkemeier@offis.de" title="philipp.reinkemeier@offis.de">philipp.reinkemeier@offis.de</a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - Annotations of /Subtype /Popup are not added to /Annots array of a page"
href="https://bugs.freedesktop.org/show_bug.cgi?id=89136">bug 89136</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>philipp.reinkemeier@offis.de
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Annotations of /Subtype /Popup are not added to /Annots array of a page"
href="https://bugs.freedesktop.org/show_bug.cgi?id=89136#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Annotations of /Subtype /Popup are not added to /Annots array of a page"
href="https://bugs.freedesktop.org/show_bug.cgi?id=89136">bug 89136</a>
from <span class="vcard"><a class="email" href="mailto:philipp.reinkemeier@offis.de" title="philipp.reinkemeier@offis.de">philipp.reinkemeier@offis.de</a>
</span></b>
<pre>Created <span class=""><a href="attachment.cgi?id=113461" name="attach_113461" title="Proposed fix">attachment 113461</a> <a href="attachment.cgi?id=113461&action=edit" title="Proposed fix">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=89136&attachment=113461'>[review]</a>
Proposed fix
The attached patch fixes this problem. Since annotations of /Subtype /Popup are
not explicit objects in the API of the glib frontend, the idea of this patch is
to add some automatic handling:
Each time a Markup annotation is added to a pdf page, then its associated Popup
annotation (if it has one) is also added to the same page.
Each time the Popup rectangle of a Markup annotation is changed using
poppler_annot_markup_set_popup(), two things happen:
- If an old Popup annotation existed and it is associated to a page, then it is
removed from that page before it gets overwritten. This is to guarantee that we
have no dangling references to it.
- If the Markup annotation already has an associated page, then the new Popup
annotation is added to the same page.
This automatic handling ensures that one can either first add a Markup
annotation to a page and set a Popup rectangle later on. Or one can first set a
Popup rectangle and add the Markup annotation to a page later on. Both cases
work just fine.
Note that the core library of poppler already takes care of removing a Popup
annotation from a page, once its associated Markup annotation is removed from a
page. So there is nothing to do on the removal part.</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>