Skip to content

Commit 1364688

Browse files
committed
Merge branch 'release/7.0.4'
2 parents 5bc3d32 + a4ddbc5 commit 1364688

File tree

914 files changed

+28087
-1797
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

914 files changed

+28087
-1797
lines changed

CONTRIBUTING.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ We have guidelines on how our git commit messages should be formatted. This lead
169169
readable messages** that are easy to follow when looking through the **project history**. But also,
170170
we use the git commit messages to **generate the iText 7 Community change log**.
171171
172+
These guidelines were taken from Chris Beams' blog post [How to Write a Git Commit Message][git-commit].
173+
172174
### Commit Message Format
173175
Each commit message consists of a **subject**, a **body** and a **footer**:
174176

@@ -180,23 +182,24 @@ Each commit message consists of a **subject**, a **body** and a **footer**:
180182
<footer>
181183
```
182184

183-
Any line of the commit message should not be longer 70 characters! This allows the message to be easier
185+
Any line of the commit message should not be longer 72 characters! This allows the message to be easier
184186
to read on GitHub as well as in various git tools.
185187

186188
### Subject
187189
The subject contains succinct description of the change:
188190

189-
* use the imperative, present tense: "change" not "changed" nor "changes"
190-
* don't capitalize first letter
191-
* no dot (.) at the end
192-
* describe what the **change** does, not the actions the developer has done
191+
* [Separate subject from body with a blank line][git-commit-separate]
192+
* [Limit the subject line to 50 characters][git-commit-limit-50]
193+
* [Capitalize the subject line][git-commit-capitalize]
194+
* [Do not end the subject line with a period][git-commit-end]
195+
* [Use the imperative mood in the subject line][git-commit-imperative]
193196

194197
### Body
195-
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
196-
The body should include the motivation for the change and contrast this with previous behavior.
198+
* [Wrap the body at 72 characters][git-commit-wrap-72]
199+
* [Use the body to explain _what_ and _why_ vs. _how_][git-commit-why-not-how]
197200

198201
### Footer
199-
The footer should contain any information about **Breaking Changes** and is also the place to
202+
The footer contains any information about **Breaking Changes** and is also the place to
200203
reference JIRA or GitHub issues that this commit **Closes**.
201204

202205

@@ -228,3 +231,11 @@ We use the [Stack Exchange][stackoverflow] network for free support and [GitHub]
228231
[mcve]: http://stackoverflow.com/help/mcve
229232
[support]: http://itextpdf.com/support
230233
[unit-testing]: http://junit.org/
234+
[git-commit]: https://chris.beams.io/posts/git-commit/
235+
[git-commit-separate]: https://chris.beams.io/posts/git-commit/#separate
236+
[git-commit-limit-50]: https://chris.beams.io/posts/git-commit/#limit-50
237+
[git-commit-capitalize]: https://chris.beams.io/posts/git-commit/#capitalize
238+
[git-commit-end]: https://chris.beams.io/posts/git-commit/#end
239+
[git-commit-imperative]: https://chris.beams.io/posts/git-commit/#imperative
240+
[git-commit-wrap-72]: https://chris.beams.io/posts/git-commit/#wrap-72
241+
[git-commit-why-not-how]: https://chris.beams.io/posts/git-commit/#why-not-how

itext.tests/itext.barcodes.tests/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
[assembly: Guid("d015a3aa-613c-45d9-b908-7d47c4b613af")]
1616

17-
[assembly: AssemblyVersion("7.0.3.0")]
18-
[assembly: AssemblyFileVersion("7.0.3.0")]
19-
[assembly: AssemblyInformationalVersion("7.0.3")]
17+
[assembly: AssemblyVersion("7.0.4.0")]
18+
[assembly: AssemblyFileVersion("7.0.4.0")]
19+
[assembly: AssemblyInformationalVersion("7.0.4")]
2020

2121
#if !NETSTANDARD1_6
2222
[assembly: NUnit.Framework.Timeout(300000)]

itext.tests/itext.barcodes.tests/itext/barcodes/BarcodeDataMatrixTest.cs

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,85 @@ public virtual void Barcode02Test() {
9595
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(destinationFolder + filename, sourceFolder
9696
+ "cmp_" + filename, destinationFolder, "diff_"));
9797
}
98+
99+
/// <exception cref="System.IO.IOException"/>
100+
/// <exception cref="iText.Kernel.PdfException"/>
101+
/// <exception cref="System.Exception"/>
102+
[NUnit.Framework.Test]
103+
public virtual void Barcode03Test() {
104+
String filename = "barcodeDataMatrix3.pdf";
105+
PdfWriter writer = new PdfWriter(destinationFolder + filename);
106+
PdfDocument document = new PdfDocument(writer);
107+
PdfPage page1 = document.AddNewPage();
108+
PdfCanvas canvas = new PdfCanvas(page1);
109+
BarcodeDataMatrix barcode3 = new BarcodeDataMatrix();
110+
barcode3.SetWidth(36);
111+
barcode3.SetHeight(12);
112+
barcode3.SetCode("AbcdFFghijklmnopqrstuWXSQ");
113+
barcode3.PlaceBarcode(canvas, Color.BLACK, 10);
114+
document.Close();
115+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(destinationFolder + filename, sourceFolder
116+
+ "cmp_" + filename, destinationFolder, "diff_"));
117+
}
118+
119+
/// <exception cref="System.IO.IOException"/>
120+
/// <exception cref="iText.Kernel.PdfException"/>
121+
/// <exception cref="System.Exception"/>
122+
[NUnit.Framework.Test]
123+
public virtual void Barcode04Test() {
124+
String filename = "barcodeDataMatrix4.pdf";
125+
PdfWriter writer = new PdfWriter(destinationFolder + filename);
126+
PdfDocument document = new PdfDocument(writer);
127+
PdfPage page1 = document.AddNewPage();
128+
PdfCanvas canvas = new PdfCanvas(page1);
129+
BarcodeDataMatrix barcode3 = new BarcodeDataMatrix();
130+
barcode3.SetWidth(36);
131+
barcode3.SetHeight(12);
132+
barcode3.SetCode("01AbcdefgAbcdefg123451231231234");
133+
barcode3.PlaceBarcode(canvas, Color.BLACK, 10);
134+
document.Close();
135+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(destinationFolder + filename, sourceFolder
136+
+ "cmp_" + filename, destinationFolder, "diff_"));
137+
}
138+
139+
/// <exception cref="System.IO.IOException"/>
140+
/// <exception cref="iText.Kernel.PdfException"/>
141+
/// <exception cref="System.Exception"/>
142+
[NUnit.Framework.Test]
143+
public virtual void Barcode05Test() {
144+
String filename = "barcodeDataMatrix5.pdf";
145+
PdfWriter writer = new PdfWriter(destinationFolder + filename);
146+
PdfDocument document = new PdfDocument(writer);
147+
PdfPage page1 = document.AddNewPage();
148+
PdfCanvas canvas = new PdfCanvas(page1);
149+
BarcodeDataMatrix barcode3 = new BarcodeDataMatrix();
150+
barcode3.SetWidth(40);
151+
barcode3.SetHeight(40);
152+
barcode3.SetCode("aaabbbcccdddAAABBBAAABBaaabbbcccdddaaa");
153+
barcode3.PlaceBarcode(canvas, Color.BLACK, 10);
154+
document.Close();
155+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(destinationFolder + filename, sourceFolder
156+
+ "cmp_" + filename, destinationFolder, "diff_"));
157+
}
158+
159+
/// <exception cref="System.IO.IOException"/>
160+
/// <exception cref="iText.Kernel.PdfException"/>
161+
/// <exception cref="System.Exception"/>
162+
[NUnit.Framework.Test]
163+
public virtual void Barcode06Test() {
164+
String filename = "barcodeDataMatrix6.pdf";
165+
PdfWriter writer = new PdfWriter(destinationFolder + filename);
166+
PdfDocument document = new PdfDocument(writer);
167+
PdfPage page1 = document.AddNewPage();
168+
PdfCanvas canvas = new PdfCanvas(page1);
169+
BarcodeDataMatrix barcode3 = new BarcodeDataMatrix();
170+
barcode3.SetWidth(36);
171+
barcode3.SetHeight(12);
172+
barcode3.SetCode(">>>\r>>>THIS VERY TEXT>>\r>");
173+
barcode3.PlaceBarcode(canvas, Color.BLACK, 10);
174+
document.Close();
175+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(destinationFolder + filename, sourceFolder
176+
+ "cmp_" + filename, destinationFolder, "diff_"));
177+
}
98178
}
99179
}

itext.tests/itext.forms.tests/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
[assembly: Guid("6fe2f714-6b3e-4b20-8c70-28bfce084ed2")]
1616

17-
[assembly: AssemblyVersion("7.0.3.0")]
18-
[assembly: AssemblyFileVersion("7.0.3.0")]
19-
[assembly: AssemblyInformationalVersion("7.0.3")]
17+
[assembly: AssemblyVersion("7.0.4.0")]
18+
[assembly: AssemblyFileVersion("7.0.4.0")]
19+
[assembly: AssemblyInformationalVersion("7.0.4")]
2020

2121
#if !NETSTANDARD1_6
2222
[assembly: NUnit.Framework.Timeout(300000)]

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

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ source product.
4848
using iText.Kernel.Pdf;
4949
using iText.Kernel.Utils;
5050
using iText.Test;
51+
using iText.Test.Attributes;
5152

5253
namespace iText.Forms {
5354
public class PdfFormFieldTest : ExtendedITextTest {
@@ -114,6 +115,29 @@ public virtual void FormFieldTest03() {
114115
}
115116
}
116117

118+
/// <exception cref="System.IO.IOException"/>
119+
[NUnit.Framework.Test]
120+
public virtual void UnicodeFormFieldTest() {
121+
String filename = sourceFolder + "unicodeFormFieldFile.pdf";
122+
PdfDocument pdfDoc = new PdfDocument(new PdfReader(filename));
123+
PdfAcroForm form = PdfAcroForm.GetAcroForm(pdfDoc, true);
124+
IDictionary<String, PdfFormField> formFields = form.GetFormFields();
125+
String fieldName = "\u5E10\u53F71";
126+
// 帐号1: account number 1
127+
NUnit.Framework.Assert.AreEqual(fieldName, formFields.Keys.ToArray(new String[1])[0]);
128+
}
129+
130+
/// <exception cref="System.IO.IOException"/>
131+
[NUnit.Framework.Test]
132+
public virtual void UnicodeFormFieldTest2() {
133+
String filename = sourceFolder + "unicodeFormFieldFile.pdf";
134+
PdfDocument pdfDoc = new PdfDocument(new PdfReader(filename));
135+
PdfAcroForm form = PdfAcroForm.GetAcroForm(pdfDoc, true);
136+
String fieldName = "\u5E10\u53F71";
137+
// 帐号1: account number 1
138+
NUnit.Framework.Assert.IsNotNull(form.GetField(fieldName));
139+
}
140+
117141
/// <exception cref="System.IO.IOException"/>
118142
/// <exception cref="System.Exception"/>
119143
[NUnit.Framework.Test]
@@ -279,5 +303,24 @@ public virtual void AutoScaleFontSizeInFormFields() {
279303
NUnit.Framework.Assert.Fail(errorMessage);
280304
}
281305
}
306+
307+
/// <exception cref="System.IO.IOException"/>
308+
/// <exception cref="System.Exception"/>
309+
[NUnit.Framework.Test]
310+
[LogMessage(iText.IO.LogMessageConstant.NO_FIELDS_IN_ACROFORM)]
311+
public virtual void AcroFieldDictionaryNoFields() {
312+
String outPdf = destinationFolder + "acroFieldDictionaryNoFields.pdf";
313+
String cmpPdf = sourceFolder + "cmp_acroFieldDictionaryNoFields.pdf";
314+
PdfWriter writer = new PdfWriter(outPdf);
315+
PdfReader reader = new PdfReader(sourceFolder + "acroFieldDictionaryNoFields.pdf");
316+
PdfDocument pdfDoc = new PdfDocument(reader, writer);
317+
PdfAcroForm form = PdfAcroForm.GetAcroForm(pdfDoc, true);
318+
pdfDoc.Close();
319+
CompareTool compareTool = new CompareTool();
320+
String errorMessage = compareTool.CompareByContent(outPdf, cmpPdf, destinationFolder, "diff_");
321+
if (errorMessage != null) {
322+
NUnit.Framework.Assert.Fail(errorMessage);
323+
}
324+
}
282325
}
283326
}

0 commit comments

Comments
 (0)