1

I am using iTextSharp to fill pre-defined fields on an existing PDF document using the folowing syntax:

PdfStamper stamper = new PdfStamper(reader, stream);
stamper.AcroFields.SetField("A","O'Henry");
stamper.FormFlattening = true;
stamper.Close();

Unfortunately, apostrophes (and likely other forms of common punctuation) are not displayed in the output PDF. For instance, in the code above, field "A" displays the text "OHENRY" instead of "O'HENRY".

How do I get the output PDF to display the text including the apostrophes?

Also, please note that I do not have control over creating/modifying the original PDF being filled. I was given the PDF from an external source and will likely be given new versions of the PDF as the form changes.

Thanks!

4

2 回答 2

1

一个简单的解决方法是用 ` 字符替换单引号。

于 2009-06-22T14:36:54.303 回答
0

我在这里找到了一个解决方案http://www.nabble.com/Populating-form-fields-with-Unicode-data-td21610346.html

该解决方案涉及在每个字段中嵌入可以处理所需字符的字体。

于 2009-06-24T20:33:45.970 回答