Hi,
I am trying to fill a pdf form with data and then flatten it. I get an exception when I am trying to set a field.
Any ideas?
Thanks.
PdfReader reader = new PdfReader( "source.pdf" );
PdfStamper stamper = new PdfStamper( reader, new FileOutputStream( "output.pdf" ) );
AcroFields form = stamper.getAcroFields();
HashMap fieldMap = form.getFields();
form.setField( "firstname", "J" ); // <-- Right here I get the Exception.
stamper.setFormFlattening( true );
stamper.close();
ExceptionConverter: java.io.UnsupportedEncodingException: MacRoman
at sun.io.Converters.getConverterClass(Unknown Source)
at sun.io.Converters.newConverter(Unknown Source)
at sun.io.ByteToCharConverter.getConverter(Unknown Source)
at java.lang.StringCoding.decode(Unknown Source)
at java.lang.String.<init>(Unknown Source)
at java.lang.String.<init>(Unknown Source)
at com.lowagie.text.pdf.PdfEncodings.convertToString(PdfEncodings.java:242)
at com.lowagie.text.pdf.DocumentFont.fillEncoding(DocumentFont.java:382)
at com.lowagie.text.pdf.DocumentFont.doType1TT(DocumentFont.java:285)
at com.lowagie.text.pdf.DocumentFont.<init>(DocumentFont.java:120)
at com.lowagie.text.pdf.AcroFields.getAppearance(AcroFields.java:535)
at com.lowagie.text.pdf.AcroFields.setField(AcroFields.java:1166)
at com.lowagie.text.pdf.AcroFields.setField(AcroFields.java:1117)
at com.coolnewcompanyX.Main.main(Main.java:64)
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
