[poppler] Reorganizing Annotation Appearance Stream Loading

Michael Vrable mvrable at cs.ucsd.edu
Tue Feb 19 20:50:29 PST 2008


I promised on IRC earlier today (or yesterday, UTC) that I'd send a 
patch off with some work to make checkboxes use the appearance streams 
provided in a PDF.

Widgets with variable text need to have their appearance streams 
completely rewritten when modified.  However, for checkboxes and radio 
boxes, the document may come with appearance streams for all the states 
the widget may be in.  Nonetheless, the current code looks like it will 
completely regenerate the appearance streams when the state of a 
checkbox is changed.  The attached patch tries to fix this by factoring 
out the code that loads the appropriate appearance stream from the PDF 
file, and re-executes it when the state of checkbox widget changes.

Please don't apply this patch as-is.  If the general idea looks sound, I 
will try to clean it up some.  This patch also touches the core of the 
annotation code again, so feedback would be good.

I saw mentioned on the mailing list the possibility of a merger of 
FormWidget and AnnotWidget classes.  If so, that might be useful work to 
have, since it would be good to have the FormWidget code more directly 
update the appearState field in the annotation (instead of currently, 
where FormWidget saves the information into the annotation dictionary, 
and the annotation code reads it back out).

I'm not in a big hurry with this patch--the original motivation for me 
to start working on this was the checkbox problem I posted a short fix 
for earlier; that short patch makes things work well enough for me for 
now.  I have another bug that I'd like to spend some time working on 
first, but I'll come back to this later.

--Michael Vrable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: annot-appearance.patch
Type: text/x-diff
Size: 4699 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/poppler/attachments/20080219/8019e88c/attachment.patch 


More information about the poppler mailing list