Skip to content

Commit 144b901

Browse files
Update cmp files, unignore and add new tests
DEVSIX-1652
1 parent 4b8ed20 commit 144b901

23 files changed

+44
-3
lines changed

layout/src/test/java/com/itextpdf/layout/AutoTaggingTest.java

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ This file is part of the iText (R) project.
5858
import com.itextpdf.kernel.pdf.PdfDictionary;
5959
import com.itextpdf.kernel.pdf.PdfDocument;
6060
import com.itextpdf.kernel.pdf.PdfName;
61+
import com.itextpdf.kernel.pdf.PdfVersion;
6162
import com.itextpdf.kernel.pdf.PdfWriter;
6263
import com.itextpdf.kernel.pdf.WriterProperties;
6364
import com.itextpdf.kernel.pdf.action.PdfAction;
@@ -566,7 +567,7 @@ public void listTest03() throws IOException, InterruptedException, ParserConfigu
566567

567568
List list = new List(ListNumberingType.DECIMAL);
568569
// explicitly overriding ListNumbering attribute
569-
list.getAccessibilityProperties().addAttributes(attributesSquare);
570+
list.getAccessibilityProperties().addAttributes(attributesSquare); // TODO not working
570571
list.add("item 1");
571572
list.add("item 2");
572573
list.add("item 3");
@@ -916,7 +917,6 @@ public void imageAndTextNoRole01() throws IOException, ParserConfigurationExcept
916917
}
917918

918919
@Test
919-
@Ignore("DEVSIX-1463")
920920
public void tableWithCaption01() throws IOException, ParserConfigurationException, SAXException, InterruptedException {
921921
PdfWriter writer = new PdfWriter(destinationFolder + "tableWithCaption01.pdf");
922922
PdfDocument pdf = new PdfDocument(writer);
@@ -979,6 +979,46 @@ public void floatListItemTest() throws IOException, ParserConfigurationException
979979
compareResult("floatListItemTest.pdf", "cmp_floatListItemTest.pdf");
980980
}
981981

982+
@Test
983+
public void createTaggedVersionOneDotFourTest01() throws IOException, InterruptedException, ParserConfigurationException, SAXException {
984+
PdfDocument pdfDocument = new PdfDocument(new PdfWriter(destinationFolder + "createTaggedVersionOneDotFourTest01.pdf", new WriterProperties().setPdfVersion(PdfVersion.PDF_1_4)));
985+
pdfDocument.setTagged();
986+
987+
Document document = new Document(pdfDocument);
988+
989+
Table table = new Table(UnitValue.createPercentArray(3)).useAllAvailableWidth()
990+
.setWidth(UnitValue.createPercentValue(100))
991+
.setFixedLayout();
992+
993+
994+
Cell cell = new Cell(1, 3).add(new Paragraph("full-width header"));
995+
cell.setRole(PdfName.TH);
996+
table.addHeaderCell(cell);
997+
for (int i = 0; i < 3; ++i) {
998+
cell = new Cell().add(new Paragraph("header " + i));
999+
cell.setRole(PdfName.TH);
1000+
table.addHeaderCell(cell);
1001+
}
1002+
1003+
for (int i = 0; i < 3; ++i) {
1004+
table.addFooterCell("footer " + i);
1005+
}
1006+
1007+
cell = new Cell(1, 3).add(new Paragraph("full-width paragraph"));
1008+
table.addCell(cell);
1009+
for (int i = 0; i < 20; ++i) {
1010+
table.addCell(createParagraph2());
1011+
}
1012+
1013+
table.addCell(new Paragraph("little text"));
1014+
1015+
document.add(table);
1016+
1017+
document.close();
1018+
1019+
compareResult("createTaggedVersionOneDotFourTest01.pdf", "cmp_createTaggedVersionOneDotFourTest01.pdf");
1020+
}
1021+
9821022
private Paragraph createParagraph1() throws IOException {
9831023
PdfFont font = PdfFontFactory.createFont(FontConstants.HELVETICA_BOLD);
9841024
Paragraph p = new Paragraph().add("text chunk. ").add("explicitly added separate text chunk");

layout/src/test/java/com/itextpdf/layout/ListTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ public void addListOnShortPage1() throws IOException, InterruptedException {
230230

231231
@Test
232232
@LogMessages(messages = {
233-
@LogMessage(count = 3, messageTemplate = LogMessageConstant.ELEMENT_DOES_NOT_FIT_AREA)
233+
@LogMessage(count = 3, messageTemplate = LogMessageConstant.ELEMENT_DOES_NOT_FIT_AREA),
234+
@LogMessage(count = 6, messageTemplate = LogMessageConstant.ATTEMPT_TO_CREATE_A_TAG_FOR_FINISHED_HINT)
234235
})
235236
public void addListOnShortPage2() throws IOException, InterruptedException {
236237
String outFileName = destinationFolder + "addListOnShortPage2.pdf";

0 commit comments

Comments
 (0)