Under Strange Circumstances, Acrobat/Reader 7 (and other versions one would
presume) will incorrectly mangle radio/check fields.

Take the following field:
<</Type/Annot/F 4 /AP<<...>> /AS/Yes /Rect[...] /Subtype/Widget /DR<<...>>
/MK<</CA(þÿ l)>> /DA(/ZaDb 0 Tf 0 0 0 rg )>>

Looking at the /CA-ption, we see a Unicode string, with the value 'l'.

Viewers with this bug see a string with the value thorn-YThingy-null-l.

As only the first character of that string matters to radio/check appearance
generation, these viewers use the "thorn", which in zapf dingbats translates to
a weird double arrow (pointing right).

I'm not sure of the trigger here, or lots of people would have seen this bug a
Long Time Ago (unless it was introduced in a recent patch I suppose).

At any rate, the workaround:

Add a new method to PdfAnnotation:
    public void setMKNormalCaptionMonoByte( String caption ) {
        getMK().put( PdfName.CA, new PdfString( caption ) );
    }

And change line 382 of RadioCheckField.java, revision 3117 (inside
getField(boolean isRadio)) to read:
            field.setMKNormalCaptionMonoByte(text);

That's it.  There's no need for a check/radio button to have a caption other
than the one to set it's 'check' shape.  One could even go so far as to rename
CaptionMonoByte to something more check-shape specific and test the length of
'caption' to be sure it's one character long.  Meh.

--Mark Storer
  Senior Software Engineer
  Cardiff.com

#include <disclaimer>
typedef std::disclaimer<Cardiff> DisCard;


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to