public virtual void WriteUtf8FieldNameAndValue() { PdfDocument pdfDoc = new PdfDocument(new PdfWriter(destinationFolder + "writeUtf8FieldNameAndValue.pdf")); PdfAcroForm form = PdfAcroForm.GetAcroForm(pdfDoc, true); PdfTextFormField field = PdfTextFormField.CreateText(pdfDoc, new Rectangle(99, 753, 425, 15), "", ""); field.SetFont(PdfFontFactory.CreateFont(FONT, PdfEncodings.IDENTITY_H)); // لا field.Put(PdfName.T, new PdfString("\u0644\u0627", PdfEncodings.UTF8)); // 福昕 福昕UTF8 field.Put(PdfName.V, new PdfString("\u798F\u6615 \u798F\u6615UTF8", PdfEncodings.UTF8)); field.RegenerateField(); form.AddField(field); pdfDoc.Close(); NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(destinationFolder + "writeUtf8FieldNameAndValue.pdf" , sourceFolder + "cmp_writeUtf8FieldNameAndValue.pdf", destinationFolder, "diffFieldNameAndValue_")); }