Note that there are some explanatory texts on larger screens.

plurals
  1. POiTextSharp - acroform field encoding
    primarykey
    data
    text
    <p>I'm trying to fill out a AcroForm's textfield with iTextSharp. The Acroform textfield was created also by iTextSharp by this piece of code:</p> <pre><code>TextField Field = new TextField(OutputWriter, FieldPos, "MyField"); OutputWriter.AddAnnotation(Field.GetTextField()); // OutputWriter is writing to form.pdf </code></pre> <p>I fill the form using this code:</p> <pre><code>PdfReader reader = new PdfReader("form.pdf"); PdfStamper filledOutForm = new PdfStamper(reader, new FileStream("filled_form.pdf", FileMode.Create)); AcroFields form = filledOutForm.AcroFields; form.SetField("MyField", "some unicode data"); </code></pre> <p>However, when I open filled_form.pdf in Acrobat Reader, unicode characters are not visible unless I edit manually the field (e.g. I append a character by hand to the field). </p> <p>I also tried to set field's font by:</p> <pre><code>BaseFont fieldFontRoman = BaseFont.CreateFont(@"C:\Windows\Fonts\times.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED); form.SetFieldProperty("MyField", "textfont", fieldFontRoman, null); </code></pre> <p>Then, when I open filled_form.pdf in Acrobat Reader, everything looks fine unless I edit manually the field. After that, non unicode characters disappear (they change into blank spaces). They are here in the field because if I copy whole content of the field by CTRL + C and paste it to notepad, I can see all characters.</p> <p>Please advise. I would like to see all characters in the field without the need of editing the field manually and of course after editing it manually I would like no characters to disappear.</p> <p>Thank you</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload