Skip to content

Commit 3708ba5

Browse files
kevinwillems1993pavel-alay
authored andcommitted
Test for DEVSIX-2033
Autoported commit. Original commit hash: [1a4910165]
2 parents 641af80 + 282e5c4 commit 3708ba5

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

itext.tests/itext.kernel.tests/itext/kernel/utils/PdfMergerTest.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,5 +215,32 @@ public virtual void MergeDocumentTest04() {
215215
NUnit.Framework.Assert.Fail(errorMessage);
216216
}
217217
}
218+
219+
/// <exception cref="System.IO.IOException"/>
220+
/// <exception cref="System.Exception"/>
221+
/// <exception cref="Javax.Xml.Parsers.ParserConfigurationException"/>
222+
/// <exception cref="Org.Xml.Sax.SAXException"/>
223+
[NUnit.Framework.Test]
224+
public virtual void MergeTableWithEmptyTdTest() {
225+
String filename = sourceFolder + "tableWithEmptyTd.pdf";
226+
String resultFile = destinationFolder + "tableWithEmptyTdResult.pdf";
227+
PdfReader reader = new PdfReader(filename);
228+
PdfDocument sourceDoc = new PdfDocument(reader);
229+
PdfDocument output = new PdfDocument(new PdfWriter(resultFile));
230+
output.SetTagged();
231+
PdfMerger merger = new PdfMerger(output).SetCloseSourceDocuments(true);
232+
merger.Merge(sourceDoc, 1, sourceDoc.GetNumberOfPages());
233+
sourceDoc.Close();
234+
reader.Close();
235+
merger.Close();
236+
output.Close();
237+
CompareTool compareTool = new CompareTool();
238+
String tagStructErrorMessage = compareTool.CompareTagStructures(resultFile, sourceFolder + "cmp_tableWithEmptyTd.pdf"
239+
);
240+
String errorMessage = tagStructErrorMessage == null ? "" : tagStructErrorMessage + "\n";
241+
if (!String.IsNullOrEmpty(errorMessage)) {
242+
NUnit.Framework.Assert.Fail(errorMessage);
243+
}
244+
}
218245
}
219246
}

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4e584b3db553b0c95f2302373db4d0a899ad71fc
1+
1a4910165bfaddba81a44cf05371fadaa19ff8b8

0 commit comments

Comments
 (0)