[poppler] Annotation bugfixes

Fabio D'Urso fabiodurso at hotmail.it
Sat Apr 21 12:52:36 PDT 2012


1) AnnotText: Always force 24x24 size with custom stamps, not only on first 
rendering

AnnotText::draw forces the bounding rectangle to be 24x24. However, the 
overridden values are lost after the first rendering, because appearance is 
not Null any more. This leads to inconsistent rendering results. This patch 
makes the 24x24 rectangle persistent.

2) Do not remove appearance stream if it's shared with other annotations

The same appearance stream can be shared by many annotations. With my previous 
code, I didn't check if a stream was shared before removing it. This patch 
implements the check by scanning all annotations in the document.
I'm attaching a document with two annotations that share the same appearance 
stream. Without this patch, if you removed one, both of them disappeared 
because the stream was removed under the other annotation's foot.

3) Preserve z-index after annotation removal

With my previous code, I implemented annotation removal by overriding the 
annotation to be removed with the last one. But it breaks z-order.
This patch implements removal by shifting subsequent elements left.
See thread "[poppler] z-order of annotation objects in PDF document".
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-AnnotText-Always-force-24x24-size-with-custom-stamps.patch
Type: text/x-patch
Size: 2004 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20120421/53cafe20/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Do-not-remove-appearance-stream-if-it-s-shared-with-.patch
Type: text/x-patch
Size: 4551 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20120421/53cafe20/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Preserve-z-index-after-annotation-removal.patch
Type: text/x-patch
Size: 1074 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20120421/53cafe20/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shared-ap-streams.pdf
Type: application/pdf
Size: 16030 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20120421/53cafe20/attachment-0001.pdf>


More information about the poppler mailing list