@@ -58,16 +58,19 @@ This file is part of the iText (R) project.
58
58
import com .itextpdf .kernel .pdf .PdfDictionary ;
59
59
import com .itextpdf .kernel .pdf .PdfDocument ;
60
60
import com .itextpdf .kernel .pdf .PdfName ;
61
+ import com .itextpdf .kernel .pdf .PdfPage ;
61
62
import com .itextpdf .kernel .pdf .PdfReader ;
62
63
import com .itextpdf .kernel .pdf .PdfVersion ;
63
64
import com .itextpdf .kernel .pdf .PdfWriter ;
64
65
import com .itextpdf .kernel .pdf .WriterProperties ;
65
66
import com .itextpdf .kernel .pdf .action .PdfAction ;
66
67
import com .itextpdf .kernel .pdf .annot .PdfLinkAnnotation ;
68
+ import com .itextpdf .kernel .pdf .canvas .PdfCanvas ;
67
69
import com .itextpdf .kernel .pdf .canvas .draw .SolidLine ;
68
70
import com .itextpdf .kernel .pdf .tagging .PdfStructureAttributes ;
69
71
import com .itextpdf .kernel .pdf .tagging .StandardRoles ;
70
72
import com .itextpdf .kernel .pdf .tagutils .TagTreePointer ;
73
+ import com .itextpdf .kernel .pdf .xobject .PdfFormXObject ;
71
74
import com .itextpdf .kernel .utils .CompareTool ;
72
75
import com .itextpdf .layout .borders .SolidBorder ;
73
76
import com .itextpdf .layout .element .IBlockElement ;
@@ -1012,6 +1015,32 @@ public void notAsciiCharTest() throws IOException, InterruptedException, SAXExce
1012
1015
compareResult ("notAsciiCharTest.pdf" , "cmp_notAsciiCharTest.pdf" );
1013
1016
}
1014
1017
1018
+ @ Test
1019
+ //TODO update cmp-file after DEVSIX-3351 fixed
1020
+ public void checkParentTreeIfFormXObjectTaggedTest () throws IOException , InterruptedException {
1021
+ String outFileName = destinationFolder + "checkParentTreeIfFormXObjectTaggedTest.pdf" ;
1022
+ String cmpPdf = sourceFolder + "cmp_checkParentTreeIfFormXObjectTaggedTest.pdf" ;
1023
+
1024
+ PdfDocument pdfDoc = new PdfDocument (new PdfWriter (outFileName ));
1025
+ pdfDoc .setTagged ();
1026
+
1027
+ PdfPage page1 = pdfDoc .addNewPage ();
1028
+
1029
+ Text txt = new Text ("Text from XObject" );
1030
+
1031
+ PdfFormXObject template = new PdfFormXObject (new Rectangle (150 , 150 ));
1032
+ Canvas canvas = new Canvas (template , pdfDoc );
1033
+ canvas .enableAutoTagging (page1 );
1034
+ canvas .add (new Paragraph (txt ));
1035
+
1036
+ PdfCanvas canvas1 = new PdfCanvas (page1 );
1037
+ canvas1 .addXObject (template , 10 , 10 );
1038
+
1039
+ pdfDoc .close ();
1040
+
1041
+ Assert .assertNull (new CompareTool ().compareByContent (outFileName , cmpPdf , destinationFolder , "diff" ));
1042
+ }
1043
+
1015
1044
@ Test
1016
1045
public void createTaggedVersionOneDotFourTest01 () throws IOException , InterruptedException , ParserConfigurationException , SAXException {
1017
1046
PdfDocument pdfDocument = new PdfDocument (new PdfWriter (destinationFolder + "createTaggedVersionOneDotFourTest01.pdf" , new WriterProperties ().setPdfVersion (PdfVersion .PDF_1_4 )));
0 commit comments