[poppler] Annotation appearance streams

Leonard Rosenthol lrosenth at adobe.com
Mon Jun 1 12:32:21 PDT 2009


Either way - whether you generate them for writing only _OR_ you generate them in order to render a document w/o them - you are going to end up writing the same code...

Be sure to take into account all of the possible options/keys in the Annot dictionary that impacts the appearance of an annotation - the predefined icons are actually some of the simplest issues you'll have to deal with.

Leonard

-----Original Message-----
From: poppler-bounces at lists.freedesktop.org [mailto:poppler-bounces at lists.freedesktop.org] On Behalf Of Carlos Garcia Campos
Sent: Monday, June 01, 2009 1:14 PM
To: poppler at lists.freedesktop.org
Subject: Re: [poppler] Annotation appearance streams

El lun, 01-06-2009 a las 14:45 +0200, Carlos Garcia Campos escribió:
> 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.

well, there's another possibility: don't provide any appearance stream at all, like this PDF:

http://www.pdfill.com/example/pdf_commenting_new.pdf

The problem is that it doesn't work with current poppler, because we are only drawing annotations that have an AP (which is something we should fix anyway)

> any other idea? am I missing something? any artist willing to write 
> icons for Text annotations? :-P
> 
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler


--
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


More information about the poppler mailing list