@@ -60,6 +60,7 @@ This file is part of the iText (R) project.
60
60
import javax .xml .parsers .ParserConfigurationException ;
61
61
import org .junit .Assert ;
62
62
import org .junit .BeforeClass ;
63
+ import org .junit .Ignore ;
63
64
import org .junit .Test ;
64
65
import org .junit .experimental .categories .Category ;
65
66
import org .xml .sax .SAXException ;
@@ -400,6 +401,26 @@ public void mergePdfWithComplexOCGTwiceTest() throws IOException, InterruptedExc
400
401
Assert .assertNull (new CompareTool ().compareByContent (outPdf , cmpPdf , destinationFolder ));
401
402
}
402
403
404
+ @ Test
405
+ @ Ignore ("TODO: DEVSIX-5064 (when doing merge with outlines infinite loop occurs )" )
406
+ public void mergeOutlinesWithWrongStructureTest () throws IOException , InterruptedException {
407
+ PdfDocument inputDoc = new PdfDocument (new PdfReader (
408
+ sourceFolder + "infiniteLoopInOutlineStructure.pdf" ));
409
+
410
+ PdfDocument outputDoc = new PdfDocument (new PdfWriter (
411
+ destinationFolder + "infiniteLoopInOutlineStructure.pdf" ));
412
+
413
+ PdfMerger merger = new PdfMerger (outputDoc , false , true );
414
+ System .out .println ("Doing merge" );
415
+ merger .merge (inputDoc , 1 , 2 );
416
+ merger .close ();
417
+ System .out .println ("Merge done" );
418
+
419
+ Assert .assertNull (new CompareTool ().compareByContent (
420
+ destinationFolder + "infiniteLoopInOutlineStructure.pdf" ,
421
+ sourceFolder + "cmp_infiniteLoopInOutlineStructure.pdf" , destinationFolder ));
422
+ }
423
+
403
424
private void mergePdfs (List <File > sources , String destination ) throws IOException {
404
425
PdfDocument mergedDoc = new PdfDocument (new PdfWriter (destination ));
405
426
PdfMerger merger = new PdfMerger (mergedDoc );
0 commit comments