Hello,
I am facing a problem that might be a bug. This is the scenario: Loading a
PDF, filling in some form text fields and saving it back to PDF. When I do
this
PDDocument doc = null;
try
{
doc = PDDocument.load( "Test.pdf" );
PDAcroForm form = doc.getDocumentCatalog().getAcroForm();
PDVariableText field = (PDVariableText)
form.getField("testField");
field.setValue("Test it 123456789012345 äüö?ß! á Ф ф Й й
άγγελος");
doc.save( "TestFilled.pdf" );
} catch (COSVisitorException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
finally
{
if( doc != null )
{
try {
doc.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
with the attached PDF file (created from scratch with Acrobat XI Standard),
the field is filled in the saved PDF file but the characters are not
presented as in code. And now the most curious thing: If you click into the
form field then the correct text will be shown. Very strange.
Is someone facing a similar problem? Is this a known bug? Does a workaround
or patch exist?
I took a look at the source code. It seems that beside the normal field
value an additional "appearence" for showing the field value is added which
maybe doesn't support unicode the way it is implemented atm.
Thanks in advance for any help,
Steffen Harbich