Skip to content

Commit 683cc4d

Browse files
committed
[RELEASE] iText 7 Core - 7.1.7
https://github.com/itext/itext7-dotnet/releases/tag/7.1.7 * release/7.1.7: Ignore tests related to SNAPSHOT being written to extracted images. [RELEASE] 7.1.7-SNAPSHOT -> 7.1.7 Deprecate duplicate methods Documentation and binary compatibility loose ends Add missing copyright headers Add log messages handler in svg Add setFont3Ways test Update javadoc for PdfFormField#drawButton() Update schema version and add license to nuspec Fix bytes retrieval from pdf byte string during PdfEncryption init Add missing copyright headers Fix smart-mode serialization content cluttering by internal buffer out-of-range bytes Make explicit fallback to zero more focused when NaN is attempted to be written Add new test for #setPage method of PdfFormField Moved Pkcs12FileHelper from sign module to pdftest module. Update port-hash Add missing copyright headers Implement disabled pseudo class selector. Minor refactoring. Add missing copyright headers SVG: Support floating numbers with exponent notation in path painting instructions Restore src and cmp in test Implement memory limits aware handler. Change PdfDocument id generation process Add System out println for compare Xmls method Explicitly fallback to zero when NaN is attempted to be written Make PdfImageXObject more independent of underlying object flushing Implement PageFlushingHelper for deep page structure flushing/releasing Update port-hash Add one more FormField test with Noto Update port-hash Fix poosible issue with incorrect DA Update port-hash Add a test which demonstrates margin-collapse processing with a custom renderer. Syncronize DA and DR. Retrieve FormField's font. SVG: Switch to PX as a default font-size metric. Update cmps. Do not fail if the appearance dictionary doesn't contain N entry. Add missing copyright headers Add new unit test for testig Pattern.split functionality in Java Add new utility method to mitigate the difference between Pattern.split in Java and Regex.Split in C# Fix NPE with windir on unix Add a getter for a set of fields for flattening in PdfAcroForm Remove invalid determinig of transparency on the page Fix Matrix.toString() Unify names of some tests and resources. Add some new SVG tests for preserveAspectRatio attribute. Add new test that demonstrates bug of PdfReader locking the file when exception occurred during parsing Fix color setting when colorspace needs to be kept Fix close-path operator not being applied Fixup for TestCrlClient making it reusable and more verbose Resolve styles of SVG tag. Add a test. Rotate signature's appearance if page is rotated. Add some new tests. Remove unpredictably failing test. Update port-hash Process scale transformation values correctly. Add some new tests. Fix XMP dc:subject property value type Reuse pdfHTML's font-size resolution algorithms. Minor refactoring. Remove unnecessary Verdana font-family usage from test svgs. Fix DataMatrix barcode porting bug Update port-hash Resolve URL containing in xlink:href attribute of SVG against baseURL Remove unused test resources Add additional file types to .gitattributes Unify text offset pattern for all justification cases Avoid adding new indirect references to the xref table when its already completely read Update port-hash Update port-hash after release [RELEASE] 7.1.6-SNAPSHOT -> 7.1.7-SNAPSHOT
2 parents 62881d2 + 1634b71 commit 683cc4d

File tree

510 files changed

+6832
-2159
lines changed

Some content is hidden

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

510 files changed

+6832
-2159
lines changed

.gitattributes

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,20 @@
55
# to LF line endings on checkout.
66
*.afm text eol=lf
77
*.cmap text eol=lf
8-
*.crt text eol=lf
98
*.cs text eol=lf ident
9+
*.css text eol=lf
10+
*.htm text eol=lf
1011
*.html text eol=lf
1112
*.java text eol=lf ident
1213
*.lng text eol=lf
1314
*.md text eol=lf
1415
*.pom text eol=lf
1516
*.properties text eol=lf
17+
*.svg text eol=lf
1618
*.txt text eol=lf
1719
*.xfdf text eol=lf
20+
*.xht text eol=lf
21+
*.xhtml text eol=lf
1822
*.xml text eol=lf
1923
port-hash text eol=lf
2024

@@ -24,21 +28,34 @@ port-hash text eol=lf
2428
*.sln text eol=crlf
2529

2630
# Denote all files that are truly binary and should not be modified.
31+
*.aif binary
32+
*.aiff binary
2733
*.bmp binary
34+
*.cer binary
2835
*.cmp binary
36+
*.crt binary
2937
*.dib binary
3038
*.gif binary
39+
*.icc binary
3140
*.j2k binary
3241
*.jb2 binary
3342
*.jp2 binary
43+
*.jpc binary
3444
*.jpg binary
3545
*.key binary
3646
*.otf binary
47+
*.p12 binary
3748
*.pdf binary
3849
*.pfb binary
50+
*.pfm binary
3951
*.png binary
52+
*.snd binary
4053
*.tif binary
4154
*.tiff binary
4255
*.ttc binary
4356
*.ttf binary
57+
*.u3d binary
58+
*.wav binary
4459
*.wmf binary
60+
*.woff binary
61+
*.woff2 binary

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.1.6.0")]
18-
[assembly: AssemblyFileVersion("7.1.6.0")]
19-
[assembly: AssemblyInformationalVersion("7.1.6")]
17+
[assembly: AssemblyVersion("7.1.7.0")]
18+
[assembly: AssemblyFileVersion("7.1.7.0")]
19+
[assembly: AssemblyInformationalVersion("7.1.7")]
2020

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

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

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ source product.
4949

5050
namespace iText.Barcodes {
5151
public class BarcodeDataMatrixTest : ExtendedITextTest {
52-
public static readonly String sourceFolder = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
53-
.CurrentContext.TestDirectory) + "/resources/itext/barcodes/";
54-
5552
public static readonly String destinationFolder = NUnit.Framework.TestContext.CurrentContext.TestDirectory
5653
+ "/test/itext/barcodes/BarcodeDataMatrix/";
5754

55+
public static readonly String sourceFolder = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
56+
.CurrentContext.TestDirectory) + "/resources/itext/barcodes/";
57+
5858
[NUnit.Framework.OneTimeSetUp]
5959
public static void BeforeClass() {
6060
CreateOrClearDestinationFolder(destinationFolder);
@@ -272,5 +272,22 @@ public virtual void Barcode15Test() {
272272
int result = barcodeDataMatrix.SetCode(str, str.Length, 0);
273273
NUnit.Framework.Assert.AreEqual(BarcodeDataMatrix.DM_NO_ERROR, result);
274274
}
275+
276+
/// <exception cref="System.IO.IOException"/>
277+
/// <exception cref="iText.Kernel.PdfException"/>
278+
/// <exception cref="System.Exception"/>
279+
[NUnit.Framework.Test]
280+
public virtual void Barcode16Test() {
281+
String filename = "barcode16Test.pdf";
282+
PdfDocument document = new PdfDocument(new PdfWriter(destinationFolder + filename));
283+
PdfCanvas canvas = new PdfCanvas(document.AddNewPage());
284+
BarcodeDataMatrix barcode = new BarcodeDataMatrix();
285+
barcode.SetCode("999999DILLERT XANG LIMITON 18 000");
286+
canvas.ConcatMatrix(1, 0, 0, 1, 100, 600);
287+
barcode.PlaceBarcode(canvas, ColorConstants.BLACK, 3);
288+
document.Close();
289+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(destinationFolder + filename, sourceFolder
290+
+ "cmp_" + filename, destinationFolder));
291+
}
275292
}
276293
}
Binary file not shown.

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.1.6.0")]
18-
[assembly: AssemblyFileVersion("7.1.6.0")]
19-
[assembly: AssemblyInformationalVersion("7.1.6")]
17+
[assembly: AssemblyVersion("7.1.7.0")]
18+
[assembly: AssemblyFileVersion("7.1.7.0")]
19+
[assembly: AssemblyInformationalVersion("7.1.7")]
2020

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

itext.tests/itext.forms.tests/itext.forms.tests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@
6868
<Project>{F9880DC4-F015-4413-AF86-66D0E9512774}</Project>
6969
<Name>itext.pdftest</Name>
7070
</ProjectReference>
71+
<ProjectReference Include="..\..\itext\itext.font-asian\itext.font-asian.csproj">
72+
<Project>{0F10190C-7611-4378-A157-03BF2ED78E30}</Project>
73+
<Name>itext.font-asian</Name>
74+
</ProjectReference>
7175
</ItemGroup>
7276
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
7377
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

itext.tests/itext.forms.tests/itext.forms.tests.netstandard.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
<ProjectReference Include="..\..\itext\itext.kernel\itext.kernel.netstandard.csproj" />
4646
<ProjectReference Include="..\..\itext\itext.layout\itext.layout.netstandard.csproj" />
4747
<ProjectReference Include="..\..\itext\itext.pdftest\itext.pdftest.netstandard.csproj" />
48+
<ProjectReference Include="..\..\itext\itext.font-asian\itext.font-asian.netstandard.csproj" />
4849
</ItemGroup>
4950
<ItemGroup>
5051
</ItemGroup>

itext.tests/itext.forms.tests/itext/forms/FlatteningTest.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ source product.
4444
using iText.Kernel.Pdf;
4545
using iText.Kernel.Utils;
4646
using iText.Test;
47+
using iText.Test.Attributes;
4748

4849
namespace iText.Forms {
4950
public class FlatteningTest : ExtendedITextTest {
@@ -71,5 +72,20 @@ public virtual void FormFlatteningTestWithAPWithoutSubtype() {
7172
doc.Close();
7273
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(dest, cmp, destinationFolder, "diff_"));
7374
}
75+
76+
/// <exception cref="System.IO.IOException"/>
77+
/// <exception cref="System.Exception"/>
78+
[NUnit.Framework.Test]
79+
[LogMessage(iText.IO.LogMessageConstant.N_ENTRY_IS_REQUIRED_FOR_APPEARANCE_DICTIONARY)]
80+
public virtual void FormFlatteningTestWithoutNEntry() {
81+
String filename = "formFlatteningTestWithoutNEntry";
82+
String src = sourceFolder + filename + ".pdf";
83+
String dest = destinationFolder + filename + "_flattened.pdf";
84+
String cmp = sourceFolder + "cmp_" + filename + "_flattened.pdf";
85+
PdfDocument doc = new PdfDocument(new PdfReader(src), new PdfWriter(dest));
86+
PdfAcroForm.GetAcroForm(doc, false).FlattenFields();
87+
doc.Close();
88+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(dest, cmp, destinationFolder, "diff_"));
89+
}
7490
}
7591
}

itext.tests/itext.forms.tests/itext/forms/FormFieldFlatteningTest.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,29 @@ public static void BeforeClass() {
6262
CreateOrClearDestinationFolder(destinationFolder);
6363
}
6464

65+
/// <exception cref="System.IO.IOException"/>
66+
[NUnit.Framework.Test]
67+
public virtual void GetFieldsForFlatteningTest() {
68+
String outPdfName = destinationFolder + "flattenedFormField.pdf";
69+
PdfDocument pdfDoc = new PdfDocument(new PdfReader(sourceFolder + "formFieldFile.pdf"), new PdfWriter(outPdfName
70+
));
71+
PdfAcroForm form = PdfAcroForm.GetAcroForm(pdfDoc, false);
72+
NUnit.Framework.Assert.AreEqual(0, form.GetFieldsForFlattening().Count);
73+
form.PartialFormFlattening("radioName");
74+
form.PartialFormFlattening("Text1");
75+
PdfFormField radioNameField = form.GetField("radioName");
76+
PdfFormField text1Field = form.GetField("Text1");
77+
NUnit.Framework.Assert.AreEqual(2, form.GetFieldsForFlattening().Count);
78+
NUnit.Framework.Assert.IsTrue(form.GetFieldsForFlattening().Contains(radioNameField));
79+
NUnit.Framework.Assert.IsTrue(form.GetFieldsForFlattening().Contains(text1Field));
80+
form.FlattenFields();
81+
pdfDoc.Close();
82+
PdfDocument outPdfDoc = new PdfDocument(new PdfReader(outPdfName));
83+
PdfAcroForm outPdfForm = PdfAcroForm.GetAcroForm(outPdfDoc, false);
84+
NUnit.Framework.Assert.AreEqual(2, outPdfForm.GetFormFields().Count);
85+
outPdfDoc.Close();
86+
}
87+
6588
/// <exception cref="System.IO.IOException"/>
6689
/// <exception cref="System.Exception"/>
6790
[NUnit.Framework.Test]

itext.tests/itext.forms.tests/itext/forms/PdfCheckBoxFieldTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public virtual void CheckBoxFontSizeTest02() {
9090
PdfDocument pdfDoc = new PdfDocument(new PdfWriter(outPdf));
9191
pdfDoc.AddNewPage();
9292
AddCheckBox(pdfDoc, 0, 730, 7, 7);
93+
// fallback to default fontsize — 12 is expected.
9394
AddCheckBox(pdfDoc, -1, 710, 7, 7);
9495
AddCheckBox(pdfDoc, 0, 640, 20, 20);
9596
AddCheckBox(pdfDoc, 0, 600, 40, 20);

itext.tests/itext.forms.tests/itext/forms/PdfFormCopyTest.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,6 @@ public virtual void CopyFieldsTest09() {
345345
/// <exception cref="System.IO.IOException"/>
346346
/// <exception cref="System.Exception"/>
347347
[NUnit.Framework.Test]
348-
[LogMessage(iText.IO.LogMessageConstant.FORM_FIELD_WAS_FLUSHED, Count = 84)]
349348
public virtual void CopyFieldsTest10() {
350349
String srcFilename = sourceFolder + "datasheet.pdf";
351350
String destFilename = destinationFolder + "copyFields10.pdf";
@@ -365,7 +364,6 @@ public virtual void CopyFieldsTest10() {
365364
/// <exception cref="System.IO.IOException"/>
366365
/// <exception cref="System.Exception"/>
367366
[NUnit.Framework.Test]
368-
[LogMessage(iText.IO.LogMessageConstant.FORM_FIELD_WAS_FLUSHED, Count = 28)]
369367
public virtual void CopyFieldsTest11() {
370368
String srcFilename1 = sourceFolder + "datasheet.pdf";
371369
String srcFilename2 = sourceFolder + "datasheet2.pdf";
@@ -387,7 +385,6 @@ public virtual void CopyFieldsTest11() {
387385
/// <exception cref="System.IO.IOException"/>
388386
/// <exception cref="System.Exception"/>
389387
[NUnit.Framework.Test]
390-
[LogMessage(iText.IO.LogMessageConstant.FORM_FIELD_WAS_FLUSHED, Count = 28)]
391388
public virtual void CopyFieldsTest12() {
392389
String srcFilename1 = sourceFolder + "datasheet.pdf";
393390
String srcFilename2 = sourceFolder + "datasheet2.pdf";

0 commit comments

Comments
 (0)