[poppler] Annotation appearance streams

Carlos Garcia Campos carlosgc at gnome.org
Mon Jun 1 05:45:08 PDT 2009


Hi all, 

I'm working on adding support for creating new annotations that can be
added to any document. The idea is just adding new constructors to the
existing Annot objects that don't require an annot dict, and setters for
the annots attributes. I don't know what to do with appearance streams,
though. Ideally, appearance streams should be built by the poppler core
to avoid duplicated code in the frontends. But appearance streams of
annotations are actually form XObjects, they are not usually a bitmap,
but a sequence of instructions to draw the annotations. For example:

q
g 0.5
G 0.75
i 0
M 4
m 2.0938 18.2158
l 2.0938 0.5
l 12.0962 0.5
l 17.1577 5.5615
l 17.1577 18.2158
l 2.0938 18.2158
h
B
rg 1 1 0
G 0
m 0.5 19.8096
l 0.5 2.0938
l 10.5024 2.0938
l 15.564 7.1553
l 15.564 19.8096
l 0.5 19.8096
h
B
m 10.46 2.1338
l 10.46 7.167
l 15.5225 7.208
S
m 4.0537 15.9824
l 12.0537 15.9824
S
m 4.0537 12.9824
l 12.0537 12.9824
S
m 4.0537 9.9824
l 8.9912 9.9824
S
Q

This is the appearance stream used by acroread to render Note icons used
in Text annotations. In the case of Text annotations we should provide
predefined appearance streams for the well-known icons:

 - Comment 
 - Key
 - Note
 - Help
 - NewParagraph
 - Paragraph
 - Insert

but for the other annots we need to figure out a way to set an
appearance stream. I'm afraid it's not going to be possible to build the
streams in the core, so the api might be just Annot::setAP (Stream
*str); and build the appearance streams in the frontends or even in the
viewers. 

any other idea? am I missing something? any artist willing to write
icons for Text annotations? :-P

-- 
Carlos Garcia Campos
   elkalmail at yahoo.es
   carlosgc at gnome.org
   http://carlosgc.linups.org
PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x523E6462
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada
 digitalmente
Url : http://lists.freedesktop.org/archives/poppler/attachments/20090601/de6252c2/attachment.pgp 


More information about the poppler mailing list