[poppler] [PATCHES] New annotation features, removal of objects from xref and arrays
Fabio D'Urso
fabiodurso at hotmail.it
Sun May 20 10:04:45 PDT 2012
On Sunday, May 20, 2012 12:27:52 PM Carlos Garcia Campos wrote:
> Why doesn't Page::removeAnnot() also remove the appearances? I've
> noticed that the qt4 implementation removes the popup and appearances
> manually. Appearance streams are only removed if there aren't any
> other annots referencing them, but is it possible to share the same
> popup by several markup annotations?
No, popups can't be shared.
> What happens with all other objects referenced by annotations? I guess they
> are all left in the document, should we remove them too? like the
> appearances?
Correct. As I told you in IRC, I didn't implement code to remove other
objects, because removing the appearance is enough for the annotation types
that can be modified via qt4.
Note that appearance stream removal itself is not finished yet. Currently, it
leaks unreferenced objects in the xref and invalid refs in the AP name tree
(see TODO comment in AnnotAppearance::removeStream).
> Maybe we could add a Annot::removeAnnotFromPage (or something like
> that) so that every annotation can implement it to remove the objects
> it references and not referenced by others.
As we discussed on chat, I like the idea of adding a virtual method to let
each annotation type "cleanup". It will be useful when we add removal support
for annotation types that reference indirect objects (sounds, attachments...).
However, I don't like the Page* argument passed to that method. I'm posting
the diff here too.
I have some doubts about setting /P if the annotation has no /P or a wrong
value, because that would mean that annotations are automatically modified as
soon as the document is loaded. If we decide to go that way, we'll also need
to be careful not to touch the last-changed timestamp.
What about storing the Page pointer itself in a dedicated field, regardless of
the /P value?
Fabio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: removeLinkedObjects.diff
Type: text/x-patch
Size: 3546 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20120520/3dc3d913/attachment.bin>
More information about the poppler
mailing list