I've tried to upgrade to the latest version (1.1.3) and got an
ClassCastException when using the methods
addComboBox(String name, String[][] options, String defaultValue,
boolean editable, BaseFont font, float fontSize,
float llx, float lly, float urx, float ury)
and
addSelectList(String name, String[][] options, String defaultValue,
BaseFont font, float fontSize, float llx, float lly,
float urx, float ury)
from class PdfAcroForm.
I've found out that the method
processOptions(String options[][])
from the class PdfFormField calls the method add(PdfArray) from the
class PdfArray. This class doesn't add the given PdfArray itself but its
member 'arrayList'. When processing the PdfArray with the method toPdf
(...) the ClassCastException occurs, because every element is casted to
an PdfObject.
After changing the implementation from
public boolean add(PdfArray other) {
if (other == null)
return false;
arrayList.add(other.arrayList);
return true;
}
to
public boolean add(PdfArray other) {
if (other == null)
return false;
arrayList.add(other);
return true;
}
everything seems to work proper again.
Best regards,
Christian
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions