Skip to content

Commit f1054ac

Browse files
Benoit Lagaeyulian-gaponenko
authored andcommitted
Add test for Unicode form field names
DEVSIX-1357 Autoported commit. Original commit hash: [30369f94e3]
1 parent 501c576 commit f1054ac

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

itext.tests/itext.forms.tests/itext/forms/PdfFormFieldTest.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,19 @@ public virtual void FormFieldTest03() {
114114
}
115115
}
116116

117+
/// <exception cref="System.IO.IOException"/>
118+
[NUnit.Framework.Test]
119+
public virtual void UnicodeFormFieldTest() {
120+
String filename = sourceFolder + "unicodeFormFieldFile.pdf";
121+
PdfDocument pdfDoc = new PdfDocument(new PdfReader(filename));
122+
PdfAcroForm form = PdfAcroForm.GetAcroForm(pdfDoc, true);
123+
IDictionary<String, PdfFormField> formFields = form.GetFormFields();
124+
byte[] result = new byte[] { (byte)0xFE, (byte)0xFF, (byte)0x5E, (byte)0x10, (byte)0x53, (byte)0xF7, (byte
125+
)0x00, (byte)0x31 };
126+
// 帐号1: account number 1
127+
NUnit.Framework.Assert.AreEqual(formFields.Keys.ToArray(new String[1])[0].GetBytes(), result);
128+
}
129+
117130
/// <exception cref="System.IO.IOException"/>
118131
/// <exception cref="System.Exception"/>
119132
[NUnit.Framework.Test]
Binary file not shown.

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
21a17e7e7b030b840aa32277d4657a66843ae25d
1+
30369f94e3e97d6837a55ab929a4c05c25a2515c

0 commit comments

Comments
 (0)