[Poppler-bugs] [Bug 89136] Annotations of /Subtype /Popup are not added to /Annots array of a page

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Feb 13 05:05:07 PST 2015


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

philipp.reinkemeier at offis.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |philipp.reinkemeier at offis.d
                   |                            |e

--- Comment #1 from philipp.reinkemeier at offis.de ---
Created attachment 113461
  --> https://bugs.freedesktop.org/attachment.cgi?id=113461&action=edit
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.

-- 
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/20150213/763d9295/attachment-0001.html>


More information about the Poppler-bugs mailing list