Hi,
I'm new in this forum. First of all i would like to thank the iText team for
your great job.
I'm having problems with Acrofields when the user introduces a text with
32766 characters or more. It seems that Adobe Reader stores the text in a
different way in such cases (as a indirect referece to a stream instead of a
String after the /V tag).
I solved this adding some code in the getField(String field) method:
public String getField(String name) {
if (xfa.isXfaPresent()) {
name = xfa.findFieldName(name, this);
if (name == null)
return null;
name = XfaForm.Xml2Som.getShortName(name);
return XfaForm.getNodeText(xfa.findDatasetsNode(name));
}
Item item = (Item)fields.get(name);
if (item == null)
return null;
lastWasString = false;
PdfObject v =
PdfReader.getPdfObject(((PdfDictionary)item.merged.get(0)).get(PdfName.V));
if (v == null)
return "";
PdfName type =
(PdfName)PdfReader.getPdfObject(((PdfDictionary)item.merged.get(0)).get(PdfName.FT));
// Cuando el valor de un campo tiene una longitud mayor a 32765
caracteres,
// se almacena como stream, y hay que decodificar su valor.
try {
if (v instanceof PdfStream) {
byte[] texto = PdfReader.getStreamBytes((PRStream)v);
return new String(texto);
}
} catch (Exception e) {
e.printStackTrace();
}
....
With this addition everything works fine.
Is this a know issue or a bug? Am I doing something wrong?
Thanks.
--
View this message in context:
http://www.nabble.com/Problem-with-fields-longer-than-32765-characters-tp23482692p23482692.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
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
Check the site with examples before you ask questions:
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/