Ejemplo n.º 1
0
 public virtual void NoninvertibleMatrixRemoveNothingTest()
 {
     String fileName = "noninvertibleMatrixRemoveNothingTest";
     String input = inputPath + "noninvertibleMatrix.pdf";
     String output = outputPath + fileName + ".pdf";
     String cmp = inputPath + "cmp_" + fileName + ".pdf";
     PdfCleanUpLocation dummyLocation = new PdfCleanUpLocation(1, new Rectangle(0, 0, 0, 0), null);
     CleanUp(input, output, JavaUtil.ArraysAsList(dummyLocation));
     CompareByContent(cmp, output, outputPath, "diff_noninvertibleMatrixRemoveNothingTest");
 }
Ejemplo n.º 2
0
 public virtual void NoninvertibleMatrixRemoveAllTest02()
 {
     String fileName = "noninvertibleMatrixRemoveAllTest02";
     String input = inputPath + "noninvertibleMatrix.pdf";
     String output = outputPath + fileName + ".pdf";
     String cmp = inputPath + "cmp_" + fileName + ".pdf";
     PdfCleanUpLocation wholePageLocation = new PdfCleanUpLocation(1, new Rectangle(-1000, -1000, 2000, 2000),
         null);
     CleanUp(input, output, JavaUtil.ArraysAsList(wholePageLocation));
     CompareByContent(cmp, output, outputPath, "diff_noninvertibleMatrixRemoveAllTest");
 }
Ejemplo n.º 3
0
        public virtual iText.PdfCleanup.PdfCleanUpTool AddCleanupLocation(PdfCleanUpLocation cleanUpLocation)
        {
            IList <PdfCleanUpLocation> pgLocations = this.pdfCleanUpLocations.Get(cleanUpLocation.GetPage());

            if (pgLocations == null)
            {
                pgLocations = new List <PdfCleanUpLocation>();
                this.pdfCleanUpLocations.Put(cleanUpLocation.GetPage(), pgLocations);
            }
            pgLocations.Add(cleanUpLocation);
            return(this);
        }
Ejemplo n.º 4
0
        public virtual void CleanTextAnnotation01()
        {
            String input  = inputPath + "cleanAnnotation.pdf";
            String output = outputPath + "cleanAnnotation_Text01.pdf";
            String cmp    = inputPath + "cmp_cleanAnnotation_Text01.pdf";
            IList <PdfCleanUpLocation> cleanUpLocations = new List <PdfCleanUpLocation>();
            PdfCleanUpLocation         textLoc          = new PdfCleanUpLocation(1, new Rectangle(150, 650, 0, 0), ColorConstants.RED);

            cleanUpLocations.Add(textLoc);
            CleanUp(input, output, cleanUpLocations);
            CompareByContent(cmp, output, outputPath, "diff_Annotation_text01");
        }
Ejemplo n.º 5
0
 /// <summary>Draws a colored rectangle on the PdfCanvas correponding to a PdfCleanUpLocation</summary>
 /// <param name="canvas">the PdfCanvas on which to draw</param>
 /// <param name="location">the PdfCleanUpLocation</param>
 private void AddColoredRectangle(PdfCanvas canvas, PdfCleanUpLocation location)
 {
     if (pdfDocument.IsTagged())
     {
         canvas.OpenTag(new CanvasArtifact());
     }
     canvas.SaveState().SetFillColor(location.GetCleanUpColor()).Rectangle(location.GetRegion()).Fill().RestoreState
         ();
     if (pdfDocument.IsTagged())
     {
         canvas.CloseTag();
     }
 }
Ejemplo n.º 6
0
        public virtual void CleanLinkAnnotation01()
        {
            String input  = inputPath + "cleanAnnotation.pdf";
            String output = outputPath + "cleanAnnotation_Link01.pdf";
            String cmp    = inputPath + "cmp_cleanAnnotation_Link01.pdf";
            IList <PdfCleanUpLocation> cleanUpLocations = new List <PdfCleanUpLocation>();
            PdfCleanUpLocation         linkLoc          = new PdfCleanUpLocation(1, new Rectangle(235, 740, 30, 16), ColorConstants.BLUE
                                                                                 );

            cleanUpLocations.Add(linkLoc);
            CleanUp(input, output, cleanUpLocations);
            CompareByContent(cmp, output, outputPath, "diff_Annotation_link01");
        }
Ejemplo n.º 7
0
        public virtual void CleanFormAnnotations02()
        {
            String input  = inputPath + "formAnnotation.pdf";
            String output = outputPath + "formAnnotation02.pdf";
            String cmp    = inputPath + "cmp_formAnnotation02.pdf";
            IList <PdfCleanUpLocation> cleanUpLocations = new List <PdfCleanUpLocation>();
            PdfCleanUpLocation         highLightLoc     = new PdfCleanUpLocation(1, new Rectangle(20, 600, 300, 100), ColorConstants
                                                                                 .YELLOW);

            cleanUpLocations.Add(highLightLoc);
            CleanUp(input, output, cleanUpLocations);
            CompareByContent(cmp, output, outputPath, "diff_form01");
        }
Ejemplo n.º 8
0
        public virtual void CleanHighlightAnnotation01()
        {
            String input  = inputPath + "cleanAnnotation.pdf";
            String output = outputPath + "cleanAnnotation_highlight01.pdf";
            String cmp    = inputPath + "cmp_cleanAnnotation_highlight01.pdf";
            IList <PdfCleanUpLocation> cleanUpLocations = new List <PdfCleanUpLocation>();
            PdfCleanUpLocation         highLightLoc     = new PdfCleanUpLocation(1, new Rectangle(105, 500, 70, 10), ColorConstants
                                                                                 .BLACK);

            cleanUpLocations.Add(highLightLoc);
            CleanUp(input, output, cleanUpLocations);
            CompareByContent(cmp, output, outputPath, "diff_text_highlight01");
        }
Ejemplo n.º 9
0
        public virtual void CleanLineAnnotation02()
        {
            String input  = inputPath + "lineAnnotationLeaders.pdf";
            String output = outputPath + "cleanLineAnnotation02.pdf";
            String cmp    = inputPath + "cmp_cleanLineAnnotation02.pdf";
            IList <PdfCleanUpLocation> cleanUpLocations = new List <PdfCleanUpLocation>();
            PdfCleanUpLocation         lineLoc          = new PdfCleanUpLocation(1, new Rectangle(100, 560, 200, 30), ColorConstants.GREEN
                                                                                 );

            cleanUpLocations.Add(lineLoc);
            CleanUp(input, output, cleanUpLocations);
            CompareByContent(cmp, output, outputPath);
        }