├── .gitattributes ├── .gitignore ├── .mailmap ├── BUILDING.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── CodeConventions.md ├── Jenkinsfile ├── LICENSE.md ├── README.md ├── SECURITY.md ├── gnu-agpl-v3.0.md ├── pom.xml ├── sharpenConfiguration.xml └── src ├── main └── java │ └── com │ └── itextpdf │ └── pdfcleanup │ ├── CleanUpProperties.java │ ├── FilteredImagesCache.java │ ├── LineDashPattern.java │ ├── PathOffsetApproximationProperties.java │ ├── PdfCleanUpEventListener.java │ ├── PdfCleanUpFilter.java │ ├── PdfCleanUpLocation.java │ ├── PdfCleanUpProcessor.java │ ├── PdfCleanUpTool.java │ ├── PdfCleaner.java │ ├── TextPositioning.java │ ├── actions │ ├── data │ │ └── PdfSweepProductData.java │ └── event │ │ └── PdfSweepProductEvent.java │ ├── autosweep │ ├── CommonRegex.java │ ├── CompositeCleanupStrategy.java │ ├── ICleanupStrategy.java │ ├── PdfAutoSweepTools.java │ └── RegexBasedCleanupStrategy.java │ ├── exceptions │ └── CleanupExceptionMessageConstant.java │ ├── logs │ └── CleanUpLogMessageConstant.java │ └── util │ ├── CleanUpCsCompareUtil.java │ ├── CleanUpHelperUtil.java │ └── CleanUpImageUtil.java ├── sharpenconfig ├── java │ └── com │ │ └── itextpdf │ │ └── pdfcleanup │ │ └── SharpenConfigMapping.java └── resources │ └── META-INF │ └── services │ └── sharpen.config.MappingConfiguration └── test ├── java └── com │ └── itextpdf │ └── pdfcleanup │ ├── BigDocumentAutoCleanUpTest.java │ ├── BigDocumentCleanUpTest.java │ ├── CleanUpAnnotationTest.java │ ├── CleanUpCsCompareUtilTest.java │ ├── CleanUpImageUtilTest.java │ ├── CleanUpInvalidPdfTest.java │ ├── CleanUpPropertiesUnitTest.java │ ├── CleanUpTaggedPdfTest.java │ ├── CleanupLicenseEventsTest.java │ ├── FilteredImagesCacheTest.java │ ├── OverlapRatioTest.java │ ├── PdfAutoSweepToolsTest.java │ ├── PdfCleanUpFilterUnitTest.java │ ├── PdfCleanUpProcessorUnitTest.java │ ├── PdfCleanUpToolTest.java │ ├── PdfCleanUpToolWithInlineImagesTest.java │ ├── RectangleTest.java │ ├── TextPositioningTest.java │ ├── UnsupportedImageTypeTest.java │ ├── images │ ├── CleanUpImageIndexedColorSpaceTest.java │ ├── CleanUpTransformedImageTest.java │ └── CleanupImageWithColorSpaceTest.java │ ├── text │ └── CleanUpTextTest.java │ ├── transparency │ └── MaskedImagesTest.java │ └── util │ └── CleanUpImagesCompareTool.java └── resources └── com └── itextpdf └── pdfcleanup ├── BigDocumentAutoCleanUpTest ├── TheSopranos.pdf ├── cleanUpAreaCalculationPrecision.pdf ├── cmp_cleanUpAreaCalculationPrecision.pdf ├── cmp_redactIPhoneUserManual.pdf ├── cmp_redactIPhoneUserManualColored.pdf ├── cmp_redactIPhoneUserManualMatchColor.pdf ├── cmp_redactTonySoprano.pdf ├── iphone_user_guide_untagged.pdf └── iphone_user_guide_untagged_small.pdf ├── BigDocumentCleanUpTest ├── chapter8_Interactive_features.pdf ├── cmp_bigTaggedDocument.pdf ├── cmp_bigUntaggedDocument.pdf ├── cmp_redactIPhoneUserManualMatchColor.pdf ├── cmp_textPositioning.pdf ├── iphone_user_guide_untagged.pdf └── textPositioning.pdf ├── CleanUpAnnotationTest ├── cleanAnnotation.pdf ├── cmp_cleanAnnotation_Line01.pdf ├── cmp_cleanAnnotation_Link01.pdf ├── cmp_cleanAnnotation_Text01.pdf ├── cmp_cleanAnnotation_full01.pdf ├── cmp_cleanAnnotation_highlight01.pdf ├── cmp_cleanFreeTextAnnotation01.pdf ├── cmp_cleanLineAnnotation02.pdf ├── cmp_cleanStrikeOutAnnotation01.pdf ├── cmp_cleanStrikeOutAnnotation02.pdf ├── cmp_formAnnotation01.pdf ├── cmp_formAnnotation02.pdf ├── cmp_watermarkAnnotation.pdf ├── formAnnotation.pdf ├── freeTextAnnotation.pdf ├── lineAnnotationLeaders.pdf ├── strikeOutAnnotQuadOutsideRect.pdf └── watermarkAnnotation.pdf ├── CleanUpInvalidPdfTest └── circularReferencesInResources.pdf ├── CleanUpTaggedPdfTest ├── cleanImage_full.pdf ├── cleanImage_partial.pdf ├── cleanPath_full.pdf ├── cleanPath_partial.pdf ├── cleanText_full.pdf ├── cleanText_partial.pdf ├── cmp_cleanImage_full.pdf ├── cmp_cleanImage_partial.pdf ├── cmp_cleanPath_full.pdf ├── cmp_cleanPath_partial.pdf ├── cmp_cleanText_full.pdf └── cmp_cleanText_partial.pdf ├── CleanupImageHandlingUtilTest └── cleanUpImageEmptyAreasToClean.png ├── FilteredImagesCacheTest ├── cmp_filteredImagesCacheFlushingTest01.pdf ├── cmp_filteredImagesCacheFlushingTest02.pdf ├── cmp_filteredImagesCacheTest01.pdf ├── cmp_filteredImagesCacheTest02.pdf ├── cmp_filteredImagesCacheTest03.pdf ├── cmp_filteredImagesCacheTest04.pdf ├── itis.jpg ├── itis2.jpg ├── multipleDifferentImageXObjectOccurrences.pdf ├── multipleImageXObjectOccurrences.pdf ├── multipleScaledImageXObjectOccurrences.pdf └── severalImageXObjectOccurrences.pdf ├── OverlapRatioTest ├── cmp_differentTextRenderInfo_.000_redact.pdf ├── cmp_differentTextRenderInfo_.001_redact.pdf ├── cmp_differentTextRenderInfo_.100_redact.pdf ├── cmp_differentTextRenderInfo_.200_redact.pdf ├── cmp_differentTextRenderInfo_.300_redact.pdf ├── cmp_differentTextRenderInfo_.400_redact.pdf ├── cmp_differentTextRenderInfo_.500_redact.pdf ├── cmp_differentTextRenderInfo_.600_redact.pdf ├── cmp_differentTextRenderInfo_.700_redact.pdf ├── cmp_differentTextRenderInfo_.800_redact.pdf ├── cmp_differentTextRenderInfo_.900_redact.pdf ├── cmp_differentTextRenderInfo_1.000_redact.pdf ├── cmp_redact_aspect_ratio_0_simple.pdf ├── cmp_redact_aspect_ratio_1_simple.pdf ├── cmp_redact_aspect_ratio_simple.pdf ├── cmp_wo_redact_aspect_ratio_simple.pdf ├── differentTextRenderInfo.pdf └── redact_aspect_ratio_simple.pdf ├── PdfAutoSweepTest ├── Lipsum.pdf ├── cmp_highlightTest.pdf ├── cmp_lineArtsDrawingOnCanvas.pdf ├── cmp_tentativeCleanUp.pdf ├── lineArtsDrawingOnCanvas.pdf └── noninvertibleMatrix.pdf ├── PdfCleanUpToolTest ├── BigImage-jpg.pdf ├── BigImage-png.pdf ├── BigImage-tif-lzw.pdf ├── BigImage-tif.pdf ├── DirectPropertyObject.pdf ├── Lipsum.pdf ├── absentICentry.pdf ├── bigOne.pdf ├── clipPathReduction.pdf ├── clippingNWRule.pdf ├── closedBezier.pdf ├── cmp_BigImage-jpg.pdf ├── cmp_BigImage-png.pdf ├── cmp_BigImage-tif-lzw.pdf ├── cmp_BigImage-tif.pdf ├── cmp_DirectPropertyObject.pdf ├── cmp_absentICentry.pdf ├── cmp_autoCleanPageTest.pdf ├── cmp_autoCleanPageWithAdditionalLocationAndPropertyTest.pdf ├── cmp_autoCleanPageWithAdditionalLocationTest.pdf ├── cmp_autoCleanWithCleaUpPropertiesTest.pdf ├── cmp_autoCleanWithFalseProcessAnnotationTest.pdf ├── cmp_autoCleanWithLocationAndStreamParamsTest.pdf ├── cmp_autoSweepCleanUpWithAdditionalLocationTest.pdf ├── cmp_bigOne.pdf ├── cmp_cleanUpDocument.pdf ├── cmp_cleanUpPage.pdf ├── cmp_cleanUpStreamParamsTest.pdf ├── cmp_clipPathReduction.pdf ├── cmp_clippingNWRule.pdf ├── cmp_closedBezier.pdf ├── cmp_complexTextPositioning.pdf ├── cmp_corruptJpeg.pdf ├── cmp_dashedBezier.pdf ├── cmp_dashedClosedRotatedTriangles.pdf ├── cmp_dashedStyledClosedBezier.pdf ├── cmp_degenerateCases.pdf ├── cmp_emptyPdf.pdf ├── cmp_emptyTj01.pdf ├── cmp_emptyTj02.pdf ├── cmp_fontCleanup.pdf ├── cmp_fullyFilteredImageDocument.pdf ├── cmp_helloHelvetica.pdf ├── cmp_helloHelvetica02.pdf ├── cmp_hello_05.pdf ├── cmp_incorrectBDCToBMCTest.pdf ├── cmp_inlineImages_full.pdf ├── cmp_lineArtsCompletely.pdf ├── cmp_lineArtsPartially.pdf ├── cmp_lineArtsSimple.pdf ├── cmp_line_chart.pdf ├── cmp_lotOfDashes.pdf ├── cmp_maskImage.pdf ├── cmp_miterTest.pdf ├── cmp_multiUseImage.pdf ├── cmp_multiUseIndirect.pdf ├── cmp_newLines01.pdf ├── cmp_newLines02.pdf ├── cmp_newLines03.pdf ├── cmp_noPropertiesInResourcesTest.pdf ├── cmp_noninvertibleMatrix.pdf ├── cmp_noninvertibleMatrixRemoveAllTest.pdf ├── cmp_noninvertibleMatrixRemoveAllTest02.pdf ├── cmp_noninvertibleMatrixRemoveNothingTest.pdf ├── cmp_page166_03.pdf ├── cmp_page166_04.pdf ├── cmp_page229-modified-Tc-Tw.pdf ├── cmp_page229_01.pdf ├── cmp_pathAndIncorrectCM.pdf ├── cmp_redactLipsumPatternStartsWithWhitespace.pdf ├── cmp_redactPdfWithNoninvertibleMatrix.pdf ├── cmp_rotatedImg.pdf ├── cmp_simpleCleanUpOnRotatedPages.pdf ├── cmp_simpleCleanUpOnRotatedPagesIgnoreRotation.pdf ├── cmp_simpleImmediate-tm.pdf ├── cmp_simpleImmediate.pdf ├── cmp_styledLineArts.pdf ├── cmp_textAndImages.pdf ├── cmp_wholePageCleanUp.pdf ├── corruptJpeg.pdf ├── dashedBezier.pdf ├── dashedClosedRotatedTriangles.pdf ├── dashedStyledClosedBezier.pdf ├── degenerateCases.pdf ├── documentWithRotatedPages.pdf ├── emptyPdf.pdf ├── emptyTj01.pdf ├── emptyTj02.pdf ├── fontCleanup.pdf ├── fullyFilteredImageDocument.pdf ├── helloHelvetica.pdf ├── helloHelvetica02.pdf ├── hello_05.pdf ├── incorrectBDCToBMCTest.pdf ├── inlineImages.pdf ├── lineArtsCompletely.pdf ├── lineArtsPartially.pdf ├── lineArtsSimple.pdf ├── line_chart.pdf ├── lotOfDashes.pdf ├── maskImage.pdf ├── miterTest.pdf ├── multiUseImage.pdf ├── multiUseIndirect.pdf ├── newLines01.pdf ├── newLines02.pdf ├── newLines03.pdf ├── new_york_times.pdf ├── noPropertiesInResourcesTest.pdf ├── noninvertibleMatrix.pdf ├── page166_03.pdf ├── page166_04.pdf ├── page229-modified-Tc-Tw.pdf ├── page229.pdf ├── pathAndIncorrectCM.pdf ├── rotatedImg.pdf ├── simpleImmediate-tm.pdf ├── simpleImmediate.pdf ├── styledLineArts.pdf └── viewer_prefs_dict_table.pdf ├── PdfCleanUpToolWithInlineImagesTest ├── cmp_inlineImageCleanup.pdf ├── cmp_inlineImages_partial.pdf ├── cmp_inlineImages_partial2.pdf ├── inlineImageCleanup.pdf └── inlineImages.pdf ├── RectangleTest └── cmp_zeroWidthLine.pdf ├── UnsupportedImageTypeTest ├── JpegCmykImage.pdf └── cmp_JpegCmykImage.pdf ├── images ├── CleanUpImageIndexedColorSpaceTest │ ├── cmp_indexedImageNoWhite.pdf │ └── indexedImageNoWhite.pdf ├── CleanUpTransformedImageTest │ ├── cmp_skewedRgbImage.pdf │ ├── skewedGrayImage.pdf │ └── skewedRgbImage.pdf └── CleanupImageWithColorSpaceTest │ ├── cmp_imgSeparationCs.pdf │ ├── cmp_imgSeparationCsJpegBaselineEncoded.pdf │ ├── cmp_imgSeparationCsJpegBaselineEncodedWithApp14Segment.pdf │ ├── imgSeparationCs.pdf │ ├── imgSeparationCsJpegBaselineEncoded.pdf │ └── imgSeparationCsJpegBaselineEncodedWithApp14Segment.pdf ├── text └── CleanUpTextTest │ ├── cleanZeroWidthTextInvalidFont.pdf │ └── cmp_cleanZeroWidthTextInvalidFont.pdf └── transparency └── MaskedImagesTest ├── cmp_imageColorKeyMaskArray.pdf ├── cmp_imageIsMask.pdf ├── cmp_imageMask.pdf ├── cmp_imageSMask.pdf ├── cmp_imageSMaskAIS.pdf ├── cmp_textOnTransparentField.pdf ├── imageColorKeyMaskArray.pdf ├── imageIsMask.pdf ├── imageMask.pdf ├── imageSMask.pdf ├── imageSMaskAIS.pdf └── textOnTransparentField.pdf /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text=auto 3 | 4 | # Explicitly declare text files you want to always be normalized and converted 5 | # to LF line endings on checkout. 6 | *.afm text eol=lf 7 | *.cmap text eol=lf 8 | *.cs text eol=lf ident 9 | *.css text eol=lf 10 | *.htm text eol=lf 11 | *.html text eol=lf 12 | *.java text eol=lf ident 13 | *.lng text eol=lf 14 | *.md text eol=lf 15 | *.pom text eol=lf 16 | *.properties text eol=lf 17 | *.svg text eol=lf 18 | *.txt text eol=lf 19 | *.xfdf text eol=lf 20 | *.xht text eol=lf 21 | *.xhtml text eol=lf 22 | *.xml text eol=lf 23 | port-hash text eol=lf 24 | 25 | # Declare files that will always have CRLF line endings on checkout. 26 | *.bat text eol=crlf 27 | *.csproj text eol=crlf 28 | *.sln text eol=crlf 29 | 30 | # Denote all files that are truly binary and should not be modified. 31 | *.aif binary 32 | *.aiff binary 33 | *.bmp binary 34 | *.cer binary 35 | *.cmp binary 36 | *.crt binary 37 | *.dib binary 38 | *.gif binary 39 | *.icc binary 40 | *.j2k binary 41 | *.jb2 binary 42 | *.jp2 binary 43 | *.jpc binary 44 | *.jpg binary 45 | *.key binary 46 | *.otf binary 47 | *.p12 binary 48 | *.pdf binary 49 | *.pfb binary 50 | *.pfm binary 51 | *.png binary 52 | *.snd binary 53 | *.tif binary 54 | *.tiff binary 55 | *.ttc binary 56 | *.ttf binary 57 | *.u3d binary 58 | *.wav binary 59 | *.wmf binary 60 | *.woff binary 61 | *.woff2 binary 62 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io 2 | 3 | ### Java ### 4 | *.class 5 | 6 | # Mobile Tools for Java (J2ME) 7 | .mtj.tmp/ 8 | 9 | # Package Files # 10 | *.jar 11 | *.war 12 | *.ear 13 | 14 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 15 | hs_err_pid* 16 | 17 | 18 | ### Eclipse ### 19 | *.pydevproject 20 | .metadata 21 | .gradle 22 | bin/ 23 | tmp/ 24 | *.tmp 25 | *.bak 26 | *.swp 27 | *~.nib 28 | local.properties 29 | .settings/ 30 | .loadpath 31 | 32 | # Eclipse Core 33 | .project 34 | 35 | # External tool builders 36 | .externalToolBuilders/ 37 | 38 | # Locally stored "Eclipse launch configurations" 39 | *.launch 40 | 41 | # CDT-specific 42 | .cproject 43 | 44 | # JDT-specific (Eclipse Java Development Tools) 45 | .classpath 46 | 47 | # PDT-specific 48 | .buildpath 49 | 50 | # sbteclipse plugin 51 | .target 52 | 53 | # TeXlipse plugin 54 | .texlipse 55 | 56 | 57 | ### Intellij ### 58 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm 59 | 60 | *.iml 61 | 62 | ## Directory-based project format: 63 | .idea/ 64 | # if you remove the above rule, at least ignore the following: 65 | 66 | # User-specific stuff: 67 | # .idea/workspace.xml 68 | # .idea/tasks.xml 69 | # .idea/dictionaries 70 | 71 | # Sensitive or high-churn files: 72 | # .idea/dataSources.ids 73 | # .idea/dataSources.xml 74 | # .idea/sqlDataSources.xml 75 | # .idea/dynamic.xml 76 | # .idea/uiDesigner.xml 77 | 78 | # Gradle: 79 | # .idea/gradle.xml 80 | # .idea/libraries 81 | 82 | # Mongo Explorer plugin: 83 | # .idea/mongoSettings.xml 84 | 85 | ## File-based project format: 86 | *.ipr 87 | *.iws 88 | 89 | ## Plugin-specific files: 90 | 91 | # IntelliJ 92 | out/ 93 | 94 | # mpeltonen/sbt-idea plugin 95 | .idea_modules/ 96 | 97 | # JIRA plugin 98 | atlassian-ide-plugin.xml 99 | 100 | # Crashlytics plugin (for Android Studio and IntelliJ) 101 | com_crashlytics_export_strings.xml 102 | crashlytics.properties 103 | crashlytics-build.properties 104 | 105 | 106 | ### NetBeans ### 107 | nbproject/private/ 108 | build/ 109 | nbbuild/ 110 | dist/ 111 | nbdist/ 112 | nbactions.xml 113 | nb-configuration.xml 114 | .nb-gradle/ 115 | 116 | 117 | ### Linux ### 118 | *~ 119 | 120 | # KDE directory preferences 121 | .directory 122 | 123 | # Linux trash folder which might appear on any partition or disk 124 | .Trash-* 125 | 126 | 127 | ### Windows ### 128 | # Windows image file caches 129 | Thumbs.db 130 | ehthumbs.db 131 | 132 | # Folder config file 133 | Desktop.ini 134 | 135 | # Recycle Bin used on file shares 136 | $RECYCLE.BIN/ 137 | 138 | # Windows Installer files 139 | *.cab 140 | *.msi 141 | *.msm 142 | *.msp 143 | 144 | # Windows shortcuts 145 | *.lnk 146 | 147 | target/ 148 | nbactions*.xml 149 | .checkstyle 150 | .pmd 151 | .pmdruleset.xml 152 | 153 | # Ignore generated files 154 | filmfestival.log 155 | 156 | .vagrant/ 157 | -------------------------------------------------------------------------------- /BUILDING.md: -------------------------------------------------------------------------------- 1 | To build **pdfSweep**, [Maven][1] must be installed. 2 | 3 | Running install without a profile will generate the **pdfSweep** jars: 4 | ```bash 5 | $ mvn clean install \ 6 | -Dmaven.test.skip=true \ 7 | -Dmaven.javadoc.failOnError=false \ 8 | > >(tee mvn.log) 2> >(tee mvn-error.log >&2) 9 | ``` 10 | 11 | To run the tests, [Ghostscript][2] and [Imagemagick][3] must be installed. 12 | ```bash 13 | $ mvn clean install \ 14 | -Dmaven.test.failure.ignore=false \ 15 | -DgsExec=$(which gs) \ 16 | -DcompareExec=$(which compare) \ 17 | -Dmaven.javadoc.failOnError=false \ 18 | > >(tee mvn.log) 2> >(tee mvn-error.log >&2) 19 | ``` 20 | 21 | You can use the supplied `Vagrantfile` to get a [Vagrant][4] VM ([Ubuntu][5] 14.04 LTS - Trusty Tahr, with [VirtualBox][6]) with all the required software installed. 22 | ```bash 23 | $ vagrant box add ubuntu/trusty64 24 | $ vagrant up 25 | $ vagrant ssh -- \ 26 | 'cd /vagrant ; mvn clean install -Dmaven.test.skip=true -Dmaven.javadoc.failOnError=false' \ 27 | > >(tee mvn.log) 2> >(tee mvn-error.log >&2) 28 | ``` 29 | 30 | [1]: http://maven.apache.org/ 31 | [2]: http://www.ghostscript.com/ 32 | [3]: http://www.imagemagick.org/ 33 | [4]: https://www.vagrantup.com/ 34 | [5]: http://www.ubuntu.com/ 35 | [6]: https://www.virtualbox.org/ -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level of experience, 9 | nationality, personal appearance, race, religion, or sexual identity and 10 | orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at http://itextpdf.com/contact. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at [http://contributor-covenant.org/version/1/4][version] 72 | 73 | [homepage]: http://contributor-covenant.org 74 | [version]: http://contributor-covenant.org/version/1/4/ 75 | -------------------------------------------------------------------------------- /CodeConventions.md: -------------------------------------------------------------------------------- 1 | # Class structure 2 | 3 | ## Constants 4 | 1. public constants (public static final) 5 | 2. protected constants (protected static final) 6 | 3. private constants (private static final) 7 | 8 | ## Fields 9 | 4. public fields 10 | 5. protected fields 11 | 6. private fields 12 | 13 | ## Constructors 14 | 7. public constructors 15 | 8. protected constructors 16 | 9. private constructors 17 | 18 | ## Methods 19 | 10. public static methods 20 | 11. public methods 21 | 12. protected static methods 22 | 13. protected methods 23 | 14. private static methods 24 | 15. private methods 25 | 26 | ## Internal classes 27 | 16. public static classes 28 | 17. public classes 29 | 18. protected static classes 30 | 19. protected classes 31 | 20. private static classes 32 | 21. private classes 33 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env groovy 2 | @Library('pipeline-library')_ 3 | 4 | def repoName = "pdfSweep" 5 | def dependencyRegex = "itextcore" 6 | 7 | automaticJavaBuild(repoName, dependencyRegex) 8 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | This program is offered under a commercial and under the AGPL license. 2 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 3 | 4 | AGPL licensing: 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU Affero General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU Affero General Public License for more details. 14 | 15 | You should have received a copy of the GNU Affero General Public License 16 | along with this program. If not, see . 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **[pdfSweep][pdfSweep]** is an [iText][itext] add on. 2 | 3 | This add on will allow you to easily redact PDF files. Redaction is the process of removing sensitive or confidential information. pdfSweep will remove this data entirely so that it won't be extractable anymore. 4 | 5 | The **pdfSweep Community** source code is hosted on [Github][github], where you can also [download the latest releases][latest]. 6 | 7 | You can also [build pdfSweep Community from source][building]. 8 | 9 | 10 | If you have an idea on how to improve **pdfSweep** and you want to submit code, 11 | please read our [Contribution Guidelines][contributing]. 12 | 13 | **pdfSweep** is dual licensed as [AGPL][agpl]/[Commercial software][sales]. 14 | 15 | AGPL is a free / open source software license. 16 | 17 | This doesn't mean the software is [gratis][gratis]! 18 | 19 | Buying a license is mandatory as soon as you develop commercial activities 20 | distributing the iText software inside your product or deploying it on a network 21 | without disclosing the source code of your own applications under the AGPL license. 22 | These activities include: 23 | 24 | - offering paid services to customers as an ASP 25 | - serving PDFs on the fly in the cloud or in a web application 26 | - shipping iText with a closed source product 27 | 28 | Contact [sales] for more info. 29 | 30 | [agpl]: LICENSE.md 31 | [building]: BUILDING.md 32 | [contributing]: https://github.com/itext/itext7/blob/develop/CONTRIBUTING.md 33 | [itext]: http://itextpdf.com/ 34 | [github]: https://github.com/itext/i7j-pdfsweep 35 | [latest]: https://github.com/itext/i7j-pdfsweep/releases/latest 36 | [sales]: http://itextpdf.com/sales 37 | [gratis]: https://en.wikipedia.org/wiki/Gratis_versus_libre 38 | [pdfSweep]: http://itextpdf.com/itext7/pdfSweep -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # iText Security Policy 2 | 3 | ## Reporting a Vulnerability 4 | 5 | We are committed to maintaining the security of our software. If you discover a security vulnerability, we encourage you to report it to us as soon as possible. 6 | 7 | To report a vulnerability, please visit our [Vulnerability Reporting Page](https://itextpdf.com/report-vulnerability), or email [vulnerability@apryse.com](vulnerability@apryse.com). If you do not receive a response in 2 business days, please follow up as we may not have received your message. 8 | 9 | We follow the procedure of Coordinated Vulnerability Disclosure (CVD) and, to protect the ecosystem, we request that those reporting do the same. Please visit the above page for more information, and follow the steps below to ensure that your report is handled promptly and appropriately: 10 | 11 | 1. **Do not disclose the vulnerability publicly** until we have had a chance to address it. 12 | 2. **Provide a detailed description** of the vulnerability, including steps to reproduce it, if possible. 13 | 3. **Include any relevant information** such as the version of pdfSweep you are using, your operating system, and any other pertinent details. 14 | 15 | ## Security Updates and Patches 16 | 17 | When a vulnerability is reported, we will: 18 | 19 | 1. **Investigate and verify** the vulnerability. 20 | 2. **Develop and test** a fix for the vulnerability. 21 | 3. **Release a patch** as soon as possible. 22 | 23 | ## Known Vulnerabilities 24 | 25 | The iText Knowledge Base has a page for known [Common Vulnerabilities and Exposures](https://kb.itextpdf.com/itext/cves) (CVEs), please check it to ensure your vulnerability has not already been disclosed or addressed. 26 | 27 | ## Supported product lines 28 | 29 | See [Compatibility Matrix](https://kb.itextpdf.com/itext/compatibility-matrix) 30 | 31 | ## Security Best Practices 32 | 33 | To help ensure the security of your applications using pdfSweep, we recommend the following best practices: 34 | 35 | 1. **Keep pdfSweep up to date** by regularly checking for and applying updates. 36 | 2. **Review and follow** our security guidelines for secure usage. 37 | 3. **Monitor your applications** for any unusual activity and investigate any anomalies promptly. 38 | 39 | Thank you for helping us keep iText secure! 40 | -------------------------------------------------------------------------------- /sharpenConfiguration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /src/main/java/com/itextpdf/pdfcleanup/CleanUpProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup; 24 | 25 | import com.itextpdf.commons.actions.contexts.IMetaInfo; 26 | import com.itextpdf.pdfcleanup.exceptions.CleanupExceptionMessageConstant; 27 | 28 | /** 29 | * Contains properties for {@link PdfCleanUpTool} operations. 30 | */ 31 | public class CleanUpProperties { 32 | //test comment for sharpen 33 | private IMetaInfo metaInfo; 34 | private boolean processAnnotations; 35 | private Double overlapRatio; 36 | private PathOffsetApproximationProperties offsetProperties = new PathOffsetApproximationProperties(); 37 | 38 | /** 39 | * Creates default CleanUpProperties instance. 40 | */ 41 | public CleanUpProperties() { 42 | processAnnotations = true; 43 | } 44 | 45 | /** 46 | * Returns metaInfo property. 47 | * 48 | * @return metaInfo property 49 | */ 50 | IMetaInfo getMetaInfo() { 51 | return metaInfo; 52 | } 53 | 54 | /** 55 | * Sets additional meta info. 56 | * 57 | * @param metaInfo the meta info to set 58 | * 59 | * @return this {@link CleanUpProperties} instance 60 | */ 61 | public CleanUpProperties setMetaInfo(IMetaInfo metaInfo) { 62 | this.metaInfo = metaInfo; 63 | return this; 64 | } 65 | 66 | /** 67 | * Check if page annotations will be processed. 68 | * Default: {@code true}. 69 | * 70 | * @return {@code true} if annotations will be processed by the {@link PdfCleanUpTool} 71 | */ 72 | public boolean isProcessAnnotations() { 73 | return processAnnotations; 74 | } 75 | 76 | /** 77 | * Set if page annotations will be processed. 78 | * Default processing behaviour: remove annotation if there is overlap with a redaction region. 79 | * 80 | * @param processAnnotations is page annotations will be processed 81 | * 82 | * @return this {@link CleanUpProperties} instance 83 | */ 84 | public CleanUpProperties setProcessAnnotations(boolean processAnnotations) { 85 | this.processAnnotations = processAnnotations; 86 | return this; 87 | } 88 | 89 | /** 90 | * Gets the overlap ratio. 91 | * This is a value between 0 and 1 that indicates how much the content region should overlap with the redaction 92 | * area to be removed. 93 | * 94 | * @return the overlap ratio or {@code null} if it has not been set. 95 | */ 96 | public Double getOverlapRatio() { 97 | return overlapRatio; 98 | } 99 | 100 | /** 101 | * Sets the overlap ratio. 102 | * This is a value between 0 and 1 that indicates how much the content region should overlap with the 103 | * redaction area to be removed. 104 | *

105 | * Example: if the overlap ratio is set to 0.3, the content region will be removed if it overlaps with 106 | * the redaction area by at least 30%. 107 | * 108 | * @param overlapRatio the overlap ratio to set 109 | * 110 | * @return this {@link CleanUpProperties} instance 111 | */ 112 | public CleanUpProperties setOverlapRatio(Double overlapRatio) { 113 | if (overlapRatio == null) { 114 | this.overlapRatio = null; 115 | return this; 116 | } 117 | if (overlapRatio <= 0 || overlapRatio > 1) { 118 | throw new IllegalArgumentException(CleanupExceptionMessageConstant.OVERLAP_RATIO_SHOULD_BE_IN_RANGE); 119 | } 120 | this.overlapRatio = overlapRatio; 121 | return this; 122 | } 123 | 124 | /** 125 | * Get {@link PathOffsetApproximationProperties} specifying approximation parameters for 126 | * {@link com.itextpdf.kernel.pdf.canvas.parser.clipper.ClipperOffset} operations. 127 | * 128 | * @return {@link PathOffsetApproximationProperties} parameters 129 | */ 130 | public PathOffsetApproximationProperties getOffsetProperties() { 131 | return offsetProperties; 132 | } 133 | 134 | /** 135 | * Set {@link PathOffsetApproximationProperties} specifying approximation parameters for 136 | * {@link com.itextpdf.kernel.pdf.canvas.parser.clipper.ClipperOffset} operations. 137 | * 138 | * @param offsetProperties {@link PathOffsetApproximationProperties} to set 139 | * 140 | * @return this {@link CleanUpProperties} instance 141 | */ 142 | public CleanUpProperties setOffsetProperties(PathOffsetApproximationProperties offsetProperties) { 143 | this.offsetProperties = offsetProperties; 144 | return this; 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /src/main/java/com/itextpdf/pdfcleanup/PathOffsetApproximationProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup; 24 | 25 | import com.itextpdf.kernel.pdf.canvas.parser.clipper.ClipperBridge; 26 | 27 | /** 28 | * Contains properties for {@link com.itextpdf.kernel.pdf.canvas.parser.clipper.ClipperOffset} operations. 29 | */ 30 | public class PathOffsetApproximationProperties { 31 | private double arcTolerance = 0.0025; 32 | private boolean calculateOffsetMultiplierDynamically = false; 33 | 34 | /** 35 | * Creates new {@link PathOffsetApproximationProperties} instance. 36 | */ 37 | public PathOffsetApproximationProperties() { 38 | // Empty constructor. 39 | } 40 | 41 | /** 42 | * Specifies if floatMultiplier should be calculated dynamically. Default value is {@code false}. 43 | * 44 | *

45 | * When a document with line arts is being cleaned up, there are a lot of calculations with floating point numbers. 46 | * All of them are translated into fixed point numbers by multiplying by this floatMultiplier coefficient. 47 | * It is possible to dynamically adjust the preciseness of the calculations. 48 | * 49 | * @param calculateDynamically {@code true} if floatMultiplier should be calculated dynamically, 50 | * {@code false} for default value specified by {@link ClipperBridge#ClipperBridge()} 51 | * 52 | * @return this {@link PathOffsetApproximationProperties} instance 53 | */ 54 | public PathOffsetApproximationProperties calculateOffsetMultiplierDynamically(boolean calculateDynamically) { 55 | this.calculateOffsetMultiplierDynamically = calculateDynamically; 56 | return this; 57 | } 58 | 59 | /** 60 | * Checks whether floatMultiplier should be calculated dynamically. 61 | * 62 | *

63 | * When a document with line arts is being cleaned up, there are a lot of calculations with floating point numbers. 64 | * All of them are translated into fixed point numbers by multiplying by this floatMultiplier coefficient. 65 | * It is possible to dynamically adjust the preciseness of the calculations. 66 | * 67 | * @return {@code true} if floatMultiplier should be calculated dynamically, {@code false} for default value 68 | */ 69 | public boolean calculateOffsetMultiplierDynamically() { 70 | return this.calculateOffsetMultiplierDynamically; 71 | } 72 | 73 | /** 74 | * Gets arc tolerance which is the maximum difference between the true and the faceted representation of curves 75 | * (arcs) in units. Used as the criterion of a good approximation of rounded line joins and line caps. 76 | * 77 | *

78 | * Since flattened paths can never perfectly represent arcs, this field/property specifies a maximum acceptable 79 | * imprecision (tolerance) when arcs are approximated in an offsetting operation. Smaller values will increase 80 | * smoothness up to a point though at a cost of performance and in creating more vertices to construct the arc. 81 | * 82 | * @return arc tolerance specifying maximum difference between the true and the faceted representation of arcs 83 | */ 84 | public double getArcTolerance() { 85 | return arcTolerance; 86 | } 87 | 88 | /** 89 | * Sets arc tolerance which is the maximum difference between the true and the faceted representation of curves 90 | * (arcs) in units. Used as the criterion of a good approximation of rounded line joins and line caps. 91 | * 92 | *

93 | * Since flattened paths can never perfectly represent arcs, this field/property specifies a maximum acceptable 94 | * imprecision (tolerance) when arcs are approximated in an offsetting operation. Smaller values will increase 95 | * smoothness up to a point though at a cost of performance and in creating more vertices to construct the arc. 96 | * 97 | * @param arcTolerance maximum difference between the true and the faceted representation of arcs 98 | * 99 | * @return this {@link PathOffsetApproximationProperties} instance 100 | */ 101 | public PathOffsetApproximationProperties setArcTolerance(double arcTolerance) { 102 | this.arcTolerance = arcTolerance; 103 | return this; 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /src/main/java/com/itextpdf/pdfcleanup/PdfCleanUpEventListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup; 24 | 25 | 26 | import com.itextpdf.kernel.exceptions.PdfException; 27 | import com.itextpdf.kernel.pdf.canvas.parser.data.IEventData; 28 | import com.itextpdf.kernel.pdf.canvas.parser.listener.IEventListener; 29 | import com.itextpdf.kernel.pdf.canvas.parser.EventType; 30 | import com.itextpdf.kernel.pdf.canvas.parser.data.ImageRenderInfo; 31 | import com.itextpdf.kernel.pdf.canvas.parser.data.PathRenderInfo; 32 | import com.itextpdf.kernel.pdf.canvas.parser.data.TextRenderInfo; 33 | 34 | import java.util.ArrayList; 35 | import java.util.List; 36 | import java.util.Set; 37 | 38 | /** 39 | * An event listener which handles cleanup related events. 40 | */ 41 | public class PdfCleanUpEventListener implements IEventListener { 42 | private static final String textDataExpected = "Text data expected."; 43 | private static final String imageDataExpected = "Image data expected."; 44 | private static final String pathDataExpected = "Path data expected."; 45 | 46 | private List content = new ArrayList<>(); 47 | 48 | /** 49 | * {@inheritDoc} 50 | */ 51 | @Override 52 | public void eventOccurred(IEventData data, EventType type) { 53 | switch (type) { 54 | case RENDER_TEXT: 55 | case RENDER_IMAGE: 56 | case RENDER_PATH: 57 | content.add(data); 58 | break; 59 | default: 60 | break; 61 | } 62 | } 63 | 64 | /** 65 | * Get the last encountered TextRenderInfo objects, then clears the internal buffer 66 | * 67 | * @return the TextRenderInfo objects that were encountered when processing the last text rendering operation 68 | */ 69 | List getEncounteredText() { 70 | if (content.size() == 0) { 71 | throw new PdfException(textDataExpected); 72 | } 73 | ArrayList text = new ArrayList<>(content.size()); 74 | for (IEventData data : content) { 75 | if (data instanceof TextRenderInfo) { 76 | text.add((TextRenderInfo) data); 77 | } else { 78 | throw new PdfException(textDataExpected); 79 | } 80 | } 81 | 82 | content.clear(); 83 | return text; 84 | } 85 | 86 | /** 87 | * Get the last encountered ImageRenderInfo, then clears the internal buffer 88 | * 89 | * @return the ImageRenderInfo object that was encountered when processing the last image rendering operation 90 | */ 91 | ImageRenderInfo getEncounteredImage() { 92 | if (content.size() == 0) { 93 | throw new PdfException(imageDataExpected); 94 | } 95 | 96 | IEventData eventData = content.get(0); 97 | if (!(eventData instanceof ImageRenderInfo)) { 98 | throw new PdfException(imageDataExpected); 99 | } 100 | content.clear(); 101 | return (ImageRenderInfo) eventData; 102 | } 103 | 104 | /** 105 | * Get the last encountered PathRenderInfo, then clears the internal buffer 106 | * 107 | * @return the PathRenderInfo object that was encountered when processing the last path rendering operation 108 | */ 109 | PathRenderInfo getEncounteredPath() { 110 | if (content.size() == 0) { 111 | throw new PdfException(pathDataExpected); 112 | } 113 | 114 | IEventData eventData = content.get(0); 115 | if (!(eventData instanceof PathRenderInfo)) { 116 | throw new PdfException(pathDataExpected); 117 | } 118 | content.clear(); 119 | return (PathRenderInfo) eventData; 120 | 121 | } 122 | 123 | /** 124 | * {@inheritDoc} 125 | */ 126 | @Override 127 | public Set getSupportedEvents() { 128 | return null; 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /src/main/java/com/itextpdf/pdfcleanup/PdfCleanUpLocation.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup; 24 | 25 | import com.itextpdf.kernel.colors.Color; 26 | import com.itextpdf.kernel.geom.Rectangle; 27 | 28 | /** 29 | * Defines the region to be erased in a PDF document. 30 | * 31 | */ 32 | public class PdfCleanUpLocation { 33 | private int page; 34 | private Rectangle region; 35 | private Color cleanUpColor; 36 | 37 | /** 38 | * Constructs a {@link PdfCleanUpLocation} object. 39 | * 40 | * @param page specifies the number of the page which the region belongs to. 41 | * @param region represents the boundaries of the area to be erased. 42 | */ 43 | public PdfCleanUpLocation(int page, Rectangle region) { 44 | this.page = page; 45 | this.region = region; 46 | } 47 | 48 | /** 49 | * Constructs a {@link PdfCleanUpLocation} object. 50 | * 51 | * @param page specifies the number of the page which the region belongs to. 52 | * @param region represents the boundaries of the area to be erased. 53 | * @param cleanUpColor a color used to fill the area after erasing it. If {@code null} 54 | * the erased area left uncolored. 55 | */ 56 | public PdfCleanUpLocation(int page, Rectangle region, Color cleanUpColor) { 57 | this(page, region); 58 | this.cleanUpColor = cleanUpColor; 59 | } 60 | 61 | /** 62 | * @return the number of the page which the region belongs to. 63 | */ 64 | public int getPage() { 65 | return page; 66 | } 67 | 68 | /** 69 | * @return A {@link Rectangle} representing the boundaries of the area to be erased. 70 | */ 71 | public Rectangle getRegion() { 72 | return region; 73 | } 74 | 75 | /** 76 | * Returns a color used to fill the area after erasing it. If {@code null} the erased area left uncolored. 77 | * 78 | * @return a color used to fill the area after erasing it. 79 | */ 80 | public Color getCleanUpColor() { 81 | return cleanUpColor; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /src/main/java/com/itextpdf/pdfcleanup/actions/data/PdfSweepProductData.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup.actions.data; 24 | 25 | import com.itextpdf.commons.actions.data.ProductData; 26 | 27 | /** 28 | * Stores an instance of {@link ProductData} related to iText pdfSweep module. 29 | */ 30 | public class PdfSweepProductData { 31 | public static final String PDF_SWEEP_PRODUCT_NAME = "pdfSweep"; 32 | public static final String PDF_SWEEP_PUBLIC_PRODUCT_NAME = PDF_SWEEP_PRODUCT_NAME; 33 | 34 | private static final String PDF_SWEEP_VERSION = "5.0.3-SNAPSHOT"; 35 | private static final int PDF_SWEEP_COPYRIGHT_SINCE = 2000; 36 | private static final int PDF_SWEEP_COPYRIGHT_TO = 2025; 37 | 38 | private static final ProductData PDF_SWEEP_PRODUCT_DATA = new ProductData(PDF_SWEEP_PUBLIC_PRODUCT_NAME, 39 | PDF_SWEEP_PRODUCT_NAME, PDF_SWEEP_VERSION, PDF_SWEEP_COPYRIGHT_SINCE, PDF_SWEEP_COPYRIGHT_TO); 40 | 41 | private PdfSweepProductData() {} 42 | 43 | /** 44 | * Getter for an instance of {@link ProductData} related to iText pdfSweep module. 45 | * 46 | * @return iText pdfSweep product description 47 | */ 48 | public static ProductData getInstance() { 49 | return PDF_SWEEP_PRODUCT_DATA; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/itextpdf/pdfcleanup/actions/event/PdfSweepProductEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup.actions.event; 24 | 25 | import com.itextpdf.commons.actions.AbstractProductProcessITextEvent; 26 | import com.itextpdf.commons.actions.confirmations.EventConfirmationType; 27 | import com.itextpdf.commons.actions.contexts.IMetaInfo; 28 | import com.itextpdf.commons.actions.sequence.SequenceId; 29 | import com.itextpdf.pdfcleanup.actions.data.PdfSweepProductData; 30 | 31 | /** 32 | * Class represents events registered in iText cleanup module. 33 | */ 34 | public class PdfSweepProductEvent extends AbstractProductProcessITextEvent { 35 | /** 36 | * Cleanup event type description. 37 | */ 38 | public static final String CLEANUP_PDF = "cleanup-pdf"; 39 | 40 | private final String eventType; 41 | 42 | /** 43 | * Creates an event associated with a general identifier and additional meta data. 44 | * 45 | * @param sequenceId is an identifier associated with the event 46 | * @param metaInfo is an additional meta info 47 | * @param eventType is a string description of the event 48 | */ 49 | private PdfSweepProductEvent(SequenceId sequenceId, IMetaInfo metaInfo, String eventType) { 50 | super(sequenceId, PdfSweepProductData.getInstance(), metaInfo, EventConfirmationType.ON_CLOSE); 51 | this.eventType = eventType; 52 | } 53 | 54 | /** 55 | * Creates a cleanup-pdf event which associated with a general identifier and additional meta data. 56 | * 57 | * @param sequenceId is an identifier associated with the event 58 | * @param metaInfo is an additional meta info 59 | * 60 | * @return the cleanup-pdf event 61 | */ 62 | public static PdfSweepProductEvent createCleanupPdfEvent(SequenceId sequenceId, IMetaInfo metaInfo) { 63 | return new PdfSweepProductEvent(sequenceId, metaInfo, CLEANUP_PDF); 64 | } 65 | 66 | @Override 67 | public String getEventType() { 68 | return eventType; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/itextpdf/pdfcleanup/autosweep/CommonRegex.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup.autosweep; 24 | 25 | import java.util.regex.Pattern; 26 | 27 | /** 28 | * This class contains some of the more common regular expressions to be used for redaction. 29 | * Most of these are copied verbatim from the "regular expression cookbook 2nd edition". 30 | */ 31 | public class CommonRegex { 32 | 33 | /* 34 | * NUMBERS 35 | */ 36 | 37 | public static Pattern MODERN_ROMAN_NUMERALS_STRICT = Pattern.compile("(?=[MDCLXVI])M*(C[MD]|D?C{0,3})(X[CL]|L?X{0,3})(I[XV]|V?I{0,3})"); 38 | public static Pattern MODERN_ROMAN_NUMERALS_FLEXIBLE = Pattern.compile("(?=[MDCLXVI])M*(C[MD]|D?C*)(X[CL]|L?X*)(I[XV]|V?I*)"); 39 | 40 | /* 41 | * MISC. 42 | */ 43 | 44 | public static Pattern US_SOCIAL_SECURITY_NUMBER = Pattern.compile("\\d{3}-\\d{2}-\\d{4}"); 45 | public static Pattern US_ZIP_CODE = Pattern.compile("\\d{5}(-\\d{4})?"); 46 | public static Pattern US_CURRENCY = Pattern.compile("\\$(\\d{1,3}(\\,\\d{3})*|(\\d+))(\\.\\d{2})?"); 47 | 48 | public static Pattern CANADA_SOCIAL_SECURITY_NUMBER = Pattern.compile("\\d{3}-\\d{3}-\\d{3}"); 49 | public static Pattern CANADA_ZIP_CODE = Pattern.compile("(?!.*[DFIOQU])[A-VXY][0-9][A-Z] ?[0-9][A-Z][0-9]"); 50 | 51 | public static Pattern UK_SOCIAL_SECURITY_NUMBER = Pattern.compile("[A-Z]{2}\\d{6}[A-Z]]"); 52 | public static Pattern UK_ZIP_CODE = Pattern.compile("[A-Z]{1,2}[0-9R][0-9A-Z]? [0-9][ABD-HJLNP-UW-Z]{2}"); 53 | public static Pattern UK_CURRENCY = Pattern.compile("£(\\d{1,3}(\\,\\d{3})*|(\\d+))(\\.\\d{2})?"); 54 | 55 | public static Pattern EU_CURRENCY = Pattern.compile("€(\\d{1,3}(\\,\\d{3})*|(\\d+))(\\.\\d{2})?"); 56 | 57 | /* 58 | * DATE AND TIME 59 | */ 60 | 61 | public static Pattern DATE_MM_DD_YYYY = Pattern.compile("\\d{1,2}[ \\/-]\\d{1,2}[ \\/-]\\d{4}"); 62 | public static Pattern DATE_MM_DD_YYYY_HH_MM_SS = Pattern.compile("\\d{1,2}[ \\/-]\\d{1,2}[ \\/-]\\d{4} \\d{1,2}:\\d{1,2}:\\d{1,2}"); 63 | public static Pattern DATE_DD_MM_YYYY = Pattern.compile("\\d{1,2}[ \\/-]\\d{1,2}[ \\/-]\\d{4}"); 64 | public static Pattern DATE_DD_MM_YYYY_HH_MM_SS = Pattern.compile("\\d{1,2}[ \\/-]\\d{1,2}[ \\/-]\\d{4} \\d{1,2}:\\d{1,2}:\\d{1,2}"); 65 | 66 | /* 67 | * ICT 68 | */ 69 | 70 | public static Pattern IPV4_ADDRESS = Pattern.compile("(?:[0-9]{1,3}\\.){3}[0-9]{1,3}"); 71 | public static Pattern IPV6_ADDRESS = Pattern.compile("(?:[a-fA-F0-9]{1,4}:){7}[a-fA-F0-9]{1,4}"); 72 | public static Pattern MAC_ADDRESS = Pattern.compile("([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])"); 73 | public static Pattern EMAIL_ADDRESS = Pattern.compile("[0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9}"); 74 | public static Pattern HTTP_URL = Pattern.compile("(https?|ftp)://[a-z0-9-]+(\\.[a-z0-9-]+)+([/?].+)?"); 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/itextpdf/pdfcleanup/autosweep/ICleanupStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup.autosweep; 24 | 25 | import com.itextpdf.kernel.colors.Color; 26 | import com.itextpdf.kernel.pdf.canvas.parser.listener.ILocationExtractionStrategy; 27 | import com.itextpdf.kernel.pdf.canvas.parser.listener.IPdfTextLocation; 28 | import com.itextpdf.pdfcleanup.PdfCleaner; 29 | 30 | /** 31 | * This class represents a generic cleanup strategy to be used with {@link PdfCleaner} or {@link PdfAutoSweepTools} 32 | * ICleanupStrategy must implement Cloneable to ensure a strategy can be reset after having handled a page. 33 | */ 34 | public interface ICleanupStrategy extends ILocationExtractionStrategy { 35 | /** 36 | * Get the color in which redaction is to take place 37 | * 38 | * @param location where to get the redaction color from 39 | * 40 | * @return a {@link Color} 41 | */ 42 | Color getRedactionColor(IPdfTextLocation location); 43 | 44 | /** 45 | * ICleanupStrategy objects have to be reset at times 46 | * {@code PdfAutoSweep} will use the same strategy for all pages, 47 | * and expects to receive only the rectangles from the last page as output. 48 | * Hence the reset method. 49 | * 50 | * @return a clone of this Object 51 | */ 52 | ICleanupStrategy reset(); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/itextpdf/pdfcleanup/autosweep/RegexBasedCleanupStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup.autosweep; 24 | 25 | import com.itextpdf.kernel.colors.Color; 26 | import com.itextpdf.kernel.colors.ColorConstants; 27 | import com.itextpdf.kernel.pdf.canvas.parser.listener.IPdfTextLocation; 28 | import com.itextpdf.kernel.pdf.canvas.parser.listener.RegexBasedLocationExtractionStrategy; 29 | 30 | import java.util.regex.Pattern; 31 | 32 | /** 33 | * This class represents a regular expression based cleanup strategy 34 | */ 35 | public class RegexBasedCleanupStrategy extends RegexBasedLocationExtractionStrategy implements ICleanupStrategy { 36 | 37 | private Pattern pattern; 38 | private Color redactionColor = ColorConstants.BLACK; 39 | 40 | /** 41 | * Creates an object of regular expression based cleanup strategy. 42 | * 43 | * @param regex regular expression on which cleanup strategy will be based 44 | */ 45 | public RegexBasedCleanupStrategy(String regex) { 46 | super(regex); 47 | this.pattern = Pattern.compile(regex); 48 | } 49 | 50 | /** 51 | * Creates an object of regular expression based cleanup strategy. 52 | * 53 | * @param pattern {@link Pattern} pattern on which cleanup strategy will be based 54 | */ 55 | public RegexBasedCleanupStrategy(Pattern pattern) { 56 | super(pattern); 57 | this.pattern = pattern; 58 | } 59 | 60 | /** 61 | * {@inheritDoc} 62 | */ 63 | @Override 64 | public Color getRedactionColor(IPdfTextLocation location) { 65 | return redactionColor; 66 | } 67 | 68 | /** 69 | * Sets the color in which redaction is to take place. 70 | * 71 | * @param color the color in which redaction is to take place 72 | * 73 | * @return this {@link RegexBasedCleanupStrategy strategy} 74 | */ 75 | public RegexBasedCleanupStrategy setRedactionColor(Color color) { 76 | this.redactionColor = color; 77 | return this; 78 | } 79 | 80 | /** 81 | * Returns an {@link ICleanupStrategy} object which is set to this regular pattern and redaction color. 82 | * 83 | * @return a reset {@link ICleanupStrategy cleanup strategy} 84 | */ 85 | public ICleanupStrategy reset() { 86 | return new RegexBasedCleanupStrategy(pattern).setRedactionColor(redactionColor); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/main/java/com/itextpdf/pdfcleanup/exceptions/CleanupExceptionMessageConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup.exceptions; 24 | 25 | /** 26 | * Class that bundles all the error message templates as constants. 27 | */ 28 | public final class CleanupExceptionMessageConstant { 29 | public static final String DEFAULT_APPEARANCE_NOT_FOUND = "DefaultAppearance is required but not found"; 30 | public static final String NONINVERTIBLE_MATRIX_CANNOT_BE_PROCESSED = "A noninvertible matrix has been parsed. " 31 | + "The behaviour is unpredictable."; 32 | public static final String PDF_DOCUMENT_MUST_BE_OPENED_IN_STAMPING_MODE = "PdfDocument must be opened in stamping " 33 | + "mode."; 34 | // Do not remove, it's used in .NET 35 | // This same exception message is thrown in CleanUpImageUtil#cleanImage when the image format is unsupported 36 | public static final String UNSUPPORTED_IMAGE_TYPE = "Unsupported image type"; 37 | public static final String OVERLAP_RATIO_SHOULD_BE_IN_RANGE = "Overlap ratio should be in range (0, 1]"; 38 | 39 | private CleanupExceptionMessageConstant(){ 40 | //empty constructor 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/itextpdf/pdfcleanup/logs/CleanUpLogMessageConstant.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup.logs; 24 | 25 | /** 26 | * Class that bundles all the log message templates as constants. 27 | */ 28 | public class CleanUpLogMessageConstant { 29 | 30 | /** The Constant CANNOT_OBTAIN_IMAGE_INFO_AFTER_FILTERING. */ 31 | public static final String CANNOT_OBTAIN_IMAGE_INFO_AFTER_FILTERING = "Cannot obtain image info after filtering."; 32 | 33 | /** The Constant FAILED_TO_PROCESS_A_TRANSFORMATION_MATRIX. */ 34 | public static final String FAILED_TO_PROCESS_A_TRANSFORMATION_MATRIX = 35 | "Failed to process a transformation matrix which is noninvertible. Some content may be placed not as " 36 | + "expected."; 37 | 38 | /** The Constant IMAGE_MASK_CLEAN_UP_NOT_SUPPORTED. */ 39 | public static final String IMAGE_MASK_CLEAN_UP_NOT_SUPPORTED = 40 | "Partial clean up of transparent images with mask encoded with one of the following filters is not " 41 | + "supported: JBIG2Decode, DCTDecode, JPXDecode. Image will become non-transparent."; 42 | 43 | /** The Constant REDACTION_OF_ANNOTATION_TYPE_WATERMARK_IS_NOT_SUPPORTED. */ 44 | public static final String REDACTION_OF_ANNOTATION_TYPE_WATERMARK_IS_NOT_SUPPORTED = 45 | "Redaction of annotation subtype /Watermark is not supported"; 46 | 47 | private CleanUpLogMessageConstant() { 48 | //Private constructor will prevent the instantiation of this class directly 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/itextpdf/pdfcleanup/util/CleanUpCsCompareUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup.util; 24 | 25 | import com.itextpdf.kernel.pdf.PdfArray; 26 | import com.itextpdf.kernel.pdf.PdfName; 27 | import com.itextpdf.kernel.pdf.PdfObject; 28 | import com.itextpdf.kernel.pdf.xobject.PdfImageXObject; 29 | import com.itextpdf.pdfcleanup.logs.CleanUpLogMessageConstant; 30 | import org.apache.commons.imaging.ImageInfo; 31 | import org.apache.commons.imaging.ImageReadException; 32 | import org.apache.commons.imaging.Imaging; 33 | import org.slf4j.Logger; 34 | import org.slf4j.LoggerFactory; 35 | 36 | import java.io.IOException; 37 | 38 | /** 39 | * Utility class providing methods to check images compatibility. 40 | */ 41 | public final class CleanUpCsCompareUtil { 42 | private static final Logger LOGGER = LoggerFactory.getLogger(CleanUpCsCompareUtil.class); 43 | 44 | private CleanUpCsCompareUtil() { 45 | } 46 | 47 | /** 48 | * Check whether the image info of the passed original image and the image info of the cleared 49 | * image are the same. 50 | * 51 | * @param originalImage {@link PdfImageXObject} of the original image 52 | * @param clearedImage {@link PdfImageXObject} of the cleared image 53 | * @return true if the image infos are the same 54 | */ 55 | public static boolean isOriginalCsCompatible(PdfImageXObject originalImage, PdfImageXObject clearedImage) { 56 | try { 57 | ImageInfo cmpInfo = Imaging.getImageInfo(originalImage.getImageBytes()); 58 | ImageInfo toCompareInfo = Imaging.getImageInfo(clearedImage.getImageBytes()); 59 | return (cmpInfo.getColorType() == toCompareInfo.getColorType() 60 | && cmpInfo.isTransparent() == toCompareInfo.isTransparent() 61 | && cmpInfo.getBitsPerPixel() == toCompareInfo.getBitsPerPixel()) 62 | || isCSApplicable(originalImage, toCompareInfo); 63 | } catch (ImageReadException | IOException e) { 64 | if (LOGGER.isErrorEnabled()) { 65 | LOGGER.error(CleanUpLogMessageConstant.CANNOT_OBTAIN_IMAGE_INFO_AFTER_FILTERING, e); 66 | } 67 | return false; 68 | } 69 | } 70 | 71 | private static boolean isCSApplicable(PdfImageXObject originalImage, ImageInfo clearedImageInfo) { 72 | PdfObject pdfColorSpace = originalImage.getPdfObject().get(PdfName.ColorSpace); 73 | PdfName name; 74 | if (pdfColorSpace.isArray()) { 75 | name = ((PdfArray) pdfColorSpace).getAsName(0); 76 | } else if (pdfColorSpace.isName()) { 77 | name = (PdfName) pdfColorSpace; 78 | } else { 79 | name = new PdfName(""); 80 | } 81 | 82 | // With use of pdf color space we can assume the image colorspace type 83 | // For Separation and DeviceGray color spaces we need to be sure that 84 | // the result image is 8 bit grayscale image 85 | if (PdfName.Separation.equals(name) || PdfName.DeviceGray.equals(name)) { 86 | return clearedImageInfo.getBitsPerPixel() == 8 87 | && clearedImageInfo.getColorType() == ImageInfo.ColorType.GRAYSCALE; 88 | } 89 | return false; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/main/java/com/itextpdf/pdfcleanup/util/CleanUpHelperUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup.util; 24 | 25 | import com.itextpdf.kernel.geom.Point; 26 | import com.itextpdf.kernel.geom.Rectangle; 27 | 28 | /** 29 | * Utility class providing clean up helping methods. 30 | */ 31 | public final class CleanUpHelperUtil { 32 | private static final float EPS = 1e-4F; 33 | 34 | private CleanUpHelperUtil() { 35 | } 36 | 37 | /** 38 | * Calculates the coordinates of the image rectangle to clean by the passed {@link Rectangle}, 39 | * specifying the area to clean. 40 | * 41 | * @param rect the {@link Rectangle} specifying the area to clean. 42 | * @param imgWidth width of the image to clean 43 | * @param imgHeight height of the image to clean 44 | * @return an array of the resultant rectangle coordinates 45 | */ 46 | public static int[] getImageRectToClean(Rectangle rect, int imgWidth, int imgHeight) { 47 | double bottom = (double) rect.getBottom() * imgHeight; 48 | int scaledBottomY = (int) Math.ceil(bottom - EPS); 49 | double top = (double) rect.getTop() * imgHeight; 50 | int scaledTopY = (int) Math.floor(top + EPS); 51 | 52 | double left = (double) rect.getLeft() * imgWidth; 53 | int x = (int) Math.ceil(left - EPS); 54 | int y = imgHeight - scaledTopY; 55 | double right = (double) rect.getRight() * imgWidth; 56 | int w = (int) Math.floor(right + EPS) - x; 57 | int h = scaledTopY - scaledBottomY; 58 | return new int[]{x, y, w, h}; 59 | } 60 | 61 | 62 | public static double calculatePolygonArea(Point[] vertices) { 63 | double sum = 0; 64 | for (int i = 0; i < vertices.length; i++) { 65 | if (i == 0) { 66 | sum += vertices[i].getX() * (vertices[i + 1].getY() - vertices[vertices.length - 1].getY()); 67 | } else if (i == vertices.length - 1) { 68 | sum += vertices[i].getX() * (vertices[0].getY() - vertices[i - 1].getY()); 69 | } else { 70 | sum += vertices[i].getX() * (vertices[i + 1].getY() - vertices[i - 1].getY()); 71 | } 72 | } 73 | return 0.5 * Math.abs(sum); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/sharpenconfig/java/com/itextpdf/pdfcleanup/SharpenConfigMapping.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup; 24 | 25 | import java.util.AbstractMap.SimpleImmutableEntry; 26 | import java.util.Arrays; 27 | import java.util.Collection; 28 | import java.util.Collections; 29 | import java.util.List; 30 | import sharpen.config.MappingConfiguration; 31 | import sharpen.config.MappingConfigurator; 32 | import sharpen.config.ModuleOption; 33 | import sharpen.config.ModulesConfigurator; 34 | import sharpen.config.OptionsConfigurator; 35 | 36 | public class SharpenConfigMapping implements MappingConfiguration { 37 | 38 | @Override 39 | public int getMappingPriority() { 40 | // leaf node in dependency tree 41 | return 0; 42 | } 43 | 44 | @Override 45 | public String getModuleName() { 46 | return "cleanup"; 47 | } 48 | 49 | @Override 50 | public void applyMappingConfiguration(MappingConfigurator configurator) { 51 | configurator.addFullName("iText.PdfCleanup.PdfCleanUpTool"); 52 | configurator.addFullName("iText.PdfCleanup.PdfCleanUpLocation"); 53 | 54 | configurator.addCustomUsingDeclaration("com.itextpdf.pdfcleanup.PdfCleanUpFilter", Arrays.asList("Paths = System.Collections.Generic.List>")); 55 | // TODO DEVSIX-1617: remove on ticket completion 56 | configurator.addAdditionalAttributes("com.itextpdf.pdfcleanup.PdfCleanUpToolWithInlineImagesTest.cleanUpTest28()", Arrays.asList("Ignore(\"DEVSIX-1617: System.Drawing.Image creates a Bitmap image object with fixed pixel format. If you try to get Graphics from such an image you'll get an exception.\" )")); 57 | // TODO DEVSIX-1617: remove on ticket completion 58 | configurator.addAdditionalAttributes("com.itextpdf.pdfcleanup.PdfCleanUpToolWithInlineImagesTest.cleanUpTest29()", Arrays.asList("Ignore(\"DEVSIX-1617: System.Drawing.Image creates a Bitmap image object with fixed pixel format. If you try to get Graphics from such an image you'll get an exception.\" )")); 59 | // TODO DEVSIX-1617: remove on ticket completion 60 | configurator.addCustomUsingDeclaration("com.itextpdf.pdfcleanup.PdfCleanUpToolWithInlineImagesTest", Arrays.asList("NUnit.Framework")); 61 | 62 | 63 | configurator.mapType("com.itextpdf.text.pdf.pdfcleanup.PdfCleanUpLocation", 64 | "iTextSharp.xtra.iTextSharp.text.pdf.pdfcleanup.PdfCleanUpLocation"); 65 | configurator.mapType("com.itextpdf.text.pdf.pdfcleanup.PdfCleanUpProcessor", 66 | "iTextSharp.xtra.iTextSharp.text.pdf.pdfcleanup.PdfCleanUpProcessor"); 67 | 68 | configurator.mapNamespace("pdfcleanup", "PdfCleanup"); 69 | } 70 | 71 | @Override 72 | public void applySharpenOptions(OptionsConfigurator configurator) { 73 | 74 | } 75 | 76 | @Override 77 | public void applyConfigModuleSettings(ModulesConfigurator configurator) { 78 | 79 | } 80 | 81 | @Override 82 | public Collection getAvailableModuleSettings() { 83 | return Collections.EMPTY_SET; 84 | } 85 | 86 | @Override 87 | public Collection getDependencies() { 88 | return Collections.EMPTY_LIST; 89 | } 90 | 91 | @Override 92 | public Collection getIgnoredSourceFiles() { 93 | return Collections.EMPTY_LIST; 94 | } 95 | 96 | @Override 97 | public Collection getIgnoredResources() { 98 | return Collections.EMPTY_LIST; 99 | } 100 | 101 | @Override 102 | public List> getOverwrittenResources() { 103 | return Collections.EMPTY_LIST; 104 | } 105 | } -------------------------------------------------------------------------------- /src/sharpenconfig/resources/META-INF/services/sharpen.config.MappingConfiguration: -------------------------------------------------------------------------------- 1 | com.itextpdf.pdfcleanup.SharpenConfigMapping -------------------------------------------------------------------------------- /src/test/java/com/itextpdf/pdfcleanup/CleanUpCsCompareUtilTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup; 24 | 25 | import com.itextpdf.kernel.pdf.PdfName; 26 | import com.itextpdf.kernel.pdf.PdfNumber; 27 | import com.itextpdf.kernel.pdf.PdfStream; 28 | import com.itextpdf.kernel.pdf.xobject.PdfImageXObject; 29 | import com.itextpdf.pdfcleanup.logs.CleanUpLogMessageConstant; 30 | import com.itextpdf.pdfcleanup.util.CleanUpCsCompareUtil; 31 | import com.itextpdf.test.ExtendedITextTest; 32 | import com.itextpdf.test.annotations.LogMessage; 33 | import com.itextpdf.test.annotations.LogMessages; 34 | import org.junit.jupiter.api.Assertions; 35 | import org.junit.jupiter.api.Tag; 36 | import org.junit.jupiter.api.Test; 37 | 38 | @Tag("IntegrationTest") 39 | public class CleanUpCsCompareUtilTest extends ExtendedITextTest { 40 | @Test 41 | public void differentImageBitsPerPixelTest() { 42 | PdfImageXObject image1 = createMockedPdfImageXObject(PdfName.DeviceRGB, 8); 43 | PdfImageXObject image2 = createMockedPdfImageXObject(PdfName.DeviceRGB, 16); 44 | 45 | Assertions.assertFalse(CleanUpCsCompareUtil.isOriginalCsCompatible(image1, image2)); 46 | } 47 | 48 | @Test 49 | public void differentImageColorTypeTest() { 50 | PdfImageXObject image1 = createMockedPdfImageXObject(PdfName.DeviceRGB, 8); 51 | PdfImageXObject image2 = createMockedPdfImageXObject(PdfName.DeviceGray, 8); 52 | 53 | Assertions.assertFalse(CleanUpCsCompareUtil.isOriginalCsCompatible(image1, image2)); 54 | } 55 | 56 | @Test 57 | public void imagesCsApplicableTest() { 58 | PdfImageXObject image1 = createMockedPdfImageXObject(PdfName.DeviceGray, 8); 59 | PdfImageXObject image2 = createMockedPdfImageXObject(PdfName.DeviceGray, 8); 60 | 61 | Assertions.assertTrue(CleanUpCsCompareUtil.isOriginalCsCompatible(image1, image2)); 62 | } 63 | 64 | @Test 65 | public void imagesNotCsApplicableTest() { 66 | PdfImageXObject image1 = createMockedPdfImageXObject(PdfName.DeviceGray, 8); 67 | PdfImageXObject image2 = createMockedPdfImageXObject(PdfName.DeviceGray, 16); 68 | 69 | Assertions.assertFalse(CleanUpCsCompareUtil.isOriginalCsCompatible(image1, image2)); 70 | } 71 | 72 | @Test 73 | @LogMessages(messages = @LogMessage(messageTemplate = CleanUpLogMessageConstant.CANNOT_OBTAIN_IMAGE_INFO_AFTER_FILTERING)) 74 | public void imageReadExceptionTest() { 75 | PdfStream stream1 = new PdfStream(); 76 | stream1.put(PdfName.BitsPerComponent, new PdfNumber(8)); 77 | stream1.put(PdfName.ColorSpace, PdfName.DeviceCMYK); 78 | PdfImageXObject image1 = new PdfImageXObject(stream1); 79 | 80 | stream1 = new PdfStream(); 81 | stream1.put(PdfName.BitsPerComponent, new PdfNumber(8)); 82 | stream1.put(PdfName.ColorSpace, PdfName.DeviceCMYK); 83 | PdfImageXObject image2 = new PdfImageXObject(stream1); 84 | 85 | Assertions.assertFalse(CleanUpCsCompareUtil.isOriginalCsCompatible(image1, image2)); 86 | } 87 | 88 | private PdfImageXObject createMockedPdfImageXObject(PdfName colorSpace, int bitsPerComponent) { 89 | PdfStream stream1 = new PdfStream(); 90 | stream1.put(PdfName.BitsPerComponent, new PdfNumber(bitsPerComponent)); 91 | stream1.put(PdfName.ColorSpace, colorSpace); 92 | stream1.put(PdfName.Width, new PdfNumber(1)); 93 | stream1.put(PdfName.Height, new PdfNumber(1)); 94 | return new PdfImageXObject(stream1); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /src/test/java/com/itextpdf/pdfcleanup/CleanUpImageUtilTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup; 24 | 25 | import com.itextpdf.io.image.ImageData; 26 | import com.itextpdf.io.image.ImageDataFactory; 27 | import com.itextpdf.kernel.geom.Rectangle; 28 | import com.itextpdf.kernel.pdf.xobject.PdfImageXObject; 29 | import com.itextpdf.pdfcleanup.util.CleanUpImageUtil; 30 | import com.itextpdf.test.ExtendedITextTest; 31 | import org.junit.jupiter.api.Assertions; 32 | import org.junit.jupiter.api.Tag; 33 | import org.junit.jupiter.api.Test; 34 | 35 | import java.util.ArrayList; 36 | import java.util.List; 37 | 38 | @Tag("IntegrationTest") 39 | public class CleanUpImageUtilTest extends ExtendedITextTest { 40 | private static final String SOURCE_PATH = "./src/test/resources/com/itextpdf/pdfcleanup/CleanupImageHandlingUtilTest/"; 41 | 42 | 43 | @Test 44 | public void cleanUpImageNullImageBytesTest() { 45 | List areasToBeCleaned = new ArrayList<>(); 46 | areasToBeCleaned.add(new Rectangle(100, 100)); 47 | Assertions.assertThrows(RuntimeException.class, () -> CleanUpImageUtil.cleanUpImage(null, areasToBeCleaned)); 48 | } 49 | 50 | @Test 51 | public void cleanUpImageEmptyAreasToCleanTest() throws Exception { 52 | ImageData data = ImageDataFactory.create(SOURCE_PATH + "cleanUpImageEmptyAreasToClean.png"); 53 | PdfImageXObject imageXObject = new PdfImageXObject(data); 54 | byte[] sourceImageBytes = imageXObject.getImageBytes(); 55 | 56 | byte[] resultImageBytes = CleanUpImageUtil.cleanUpImage(new PdfImageXObject(data).getImageBytes(), 57 | new ArrayList()); 58 | 59 | Assertions.assertArrayEquals(sourceImageBytes, resultImageBytes); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/test/java/com/itextpdf/pdfcleanup/CleanUpInvalidPdfTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup; 24 | 25 | import com.itextpdf.kernel.pdf.PdfDocument; 26 | import com.itextpdf.kernel.pdf.PdfReader; 27 | import com.itextpdf.kernel.pdf.PdfWriter; 28 | import com.itextpdf.test.ExtendedITextTest; 29 | 30 | import java.io.ByteArrayOutputStream; 31 | import java.io.IOException; 32 | import java.util.ArrayList; 33 | import java.util.List; 34 | import org.junit.jupiter.api.Assertions; 35 | import org.junit.jupiter.api.BeforeAll; 36 | import org.junit.jupiter.api.Disabled; 37 | import org.junit.jupiter.api.Tag; 38 | import org.junit.jupiter.api.Test; 39 | 40 | @Tag("IntegrationTest") 41 | public class CleanUpInvalidPdfTest extends ExtendedITextTest { 42 | private static final String inputPath = "./src/test/resources/com/itextpdf/pdfcleanup/CleanUpInvalidPdfTest/"; 43 | private static final String outputPath = "./target/test/com/itextpdf/pdfcleanup/CleanUpInvalidPdfTest/"; 44 | 45 | 46 | @BeforeAll 47 | public static void before() { 48 | createOrClearDestinationFolder(outputPath); 49 | } 50 | 51 | @Test 52 | @Disabled("DEVSIX-3608: this test currently throws StackOverflowError, which cannot be caught in .NET") 53 | public void cleanCircularReferencesInResourcesTest() { 54 | 55 | Assertions.assertThrows(StackOverflowError.class, () -> { 56 | String input = inputPath + "circularReferencesInResources.pdf"; 57 | 58 | PdfDocument pdfDocument = new PdfDocument(new PdfReader(input), new PdfWriter(new ByteArrayOutputStream())); 59 | List cleanUpLocations = new ArrayList(); 60 | cleanUpLocations.add(new PdfCleanUpLocation(1, pdfDocument.getPage(1).getPageSize(), null)); 61 | 62 | PdfCleaner.cleanUp(pdfDocument, cleanUpLocations); 63 | 64 | pdfDocument.close(); 65 | }); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/test/java/com/itextpdf/pdfcleanup/CleanUpPropertiesUnitTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup; 24 | 25 | import com.itextpdf.pdfcleanup.exceptions.CleanupExceptionMessageConstant; 26 | import com.itextpdf.test.ExtendedITextTest; 27 | import org.junit.jupiter.api.Test; 28 | import org.junit.jupiter.api.Tag; 29 | 30 | import static org.junit.jupiter.api.Assertions.*; 31 | 32 | @Tag("UnitTest") 33 | public class CleanUpPropertiesUnitTest extends ExtendedITextTest { 34 | 35 | 36 | @Test 37 | public void nePropsAspectRatioReturnsNull(){ 38 | CleanUpProperties properties = new CleanUpProperties(); 39 | assertNull(properties.getOverlapRatio()); 40 | } 41 | 42 | @Test 43 | public void setAspectRatioWithValue0IsOk(){ 44 | CleanUpProperties properties = new CleanUpProperties(); 45 | Exception e = assertThrows(IllegalArgumentException.class, () -> properties.setOverlapRatio(0d)); 46 | assertEquals(CleanupExceptionMessageConstant.OVERLAP_RATIO_SHOULD_BE_IN_RANGE, e.getMessage()); 47 | } 48 | 49 | @Test 50 | public void setAspectRatioWithValue1IsOk(){ 51 | CleanUpProperties properties = new CleanUpProperties(); 52 | properties.setOverlapRatio(1.0); 53 | assertEquals(1.0, properties.getOverlapRatio()); 54 | } 55 | 56 | @Test 57 | public void setAspectRatioWithValueGreaterThan1ThrowsException(){ 58 | CleanUpProperties properties = new CleanUpProperties(); 59 | Exception e = assertThrows(IllegalArgumentException.class, () -> properties.setOverlapRatio(1.1)); 60 | assertEquals(CleanupExceptionMessageConstant.OVERLAP_RATIO_SHOULD_BE_IN_RANGE, e.getMessage()); 61 | } 62 | 63 | @Test 64 | public void setAspectRatioWithValueLessThan0ThrowsException(){ 65 | CleanUpProperties properties = new CleanUpProperties(); 66 | Exception e = assertThrows(IllegalArgumentException.class, () -> properties.setOverlapRatio(-0.1)); 67 | assertEquals(CleanupExceptionMessageConstant.OVERLAP_RATIO_SHOULD_BE_IN_RANGE, e.getMessage()); 68 | } 69 | 70 | @Test 71 | public void setAspectRatioWithValue0_5IsOk(){ 72 | CleanUpProperties properties = new CleanUpProperties(); 73 | properties.setOverlapRatio(0.5); 74 | assertEquals(0.5, properties.getOverlapRatio()); 75 | } 76 | 77 | @Test 78 | public void settingAspectRatioToNullIsOk(){ 79 | CleanUpProperties properties = new CleanUpProperties(); 80 | properties.setOverlapRatio(0.5); 81 | properties.setOverlapRatio(null); 82 | assertNull(properties.getOverlapRatio()); 83 | } 84 | 85 | @Test 86 | public void setGetPathOffsetApproximationPropertiesTest(){ 87 | PathOffsetApproximationProperties pathOffsetApproximationProperties = new PathOffsetApproximationProperties() 88 | .calculateOffsetMultiplierDynamically(true) 89 | .setArcTolerance(0.0015); 90 | CleanUpProperties properties = new CleanUpProperties().setOffsetProperties(pathOffsetApproximationProperties); 91 | assertTrue(properties.getOffsetProperties().calculateOffsetMultiplierDynamically()); 92 | assertEquals(0.0015, properties.getOffsetProperties().getArcTolerance()); 93 | } 94 | } -------------------------------------------------------------------------------- /src/test/java/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup; 24 | 25 | import com.itextpdf.kernel.pdf.PdfDocument; 26 | import com.itextpdf.kernel.pdf.PdfReader; 27 | import com.itextpdf.kernel.pdf.PdfWriter; 28 | import com.itextpdf.kernel.utils.CompareTool; 29 | import com.itextpdf.test.ExtendedITextTest; 30 | import java.io.IOException; 31 | import java.util.List; 32 | import org.junit.jupiter.api.Assertions; 33 | import org.junit.jupiter.api.BeforeAll; 34 | import org.junit.jupiter.api.Tag; 35 | import org.junit.jupiter.api.Test; 36 | 37 | @Tag("IntegrationTest") 38 | public class CleanUpTaggedPdfTest extends ExtendedITextTest { 39 | private static final String inputPath = "./src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/"; 40 | private static final String outputPath = "./target/test/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/"; 41 | @BeforeAll 42 | public static void before() { 43 | createOrClearDestinationFolder(outputPath); 44 | } 45 | 46 | @Test 47 | public void cleanTextFull() throws IOException, InterruptedException { 48 | String input = inputPath + "cleanText_full.pdf"; 49 | String output = outputPath + "cleanText_full.pdf"; 50 | String cmp = inputPath + "cmp_cleanText_full.pdf"; 51 | 52 | cleanUp(input, output, null); 53 | compareByContent(cmp, output, outputPath, "diff_text_full"); 54 | } 55 | 56 | @Test 57 | public void cleanTextPartial() throws IOException, InterruptedException { 58 | String input = inputPath + "cleanText_partial.pdf"; 59 | String output = outputPath + "cleanText_partial.pdf"; 60 | String cmp = inputPath + "cmp_cleanText_partial.pdf"; 61 | 62 | cleanUp(input, output, null); 63 | compareByContent(cmp, output, outputPath, "diff_text_partial"); 64 | } 65 | 66 | @Test 67 | public void cleanImageFull() throws IOException, InterruptedException { 68 | String input = inputPath + "cleanImage_full.pdf"; 69 | String output = outputPath + "cleanImage_full.pdf"; 70 | String cmp = inputPath + "cmp_cleanImage_full.pdf"; 71 | 72 | cleanUp(input, output, null); 73 | compareByContent(cmp, output, outputPath, "diff_image_full"); 74 | } 75 | 76 | @Test 77 | public void cleanImagePartial() throws IOException, InterruptedException { 78 | String input = inputPath + "cleanImage_partial.pdf"; 79 | String output = outputPath + "cleanImage_partial.pdf"; 80 | String cmp = inputPath + "cmp_cleanImage_partial.pdf"; 81 | 82 | cleanUp(input, output, null); 83 | compareByContent(cmp, output, outputPath, "diff_image_partial"); 84 | } 85 | 86 | @Test 87 | public void cleanPathFull() throws IOException, InterruptedException { 88 | String input = inputPath + "cleanPath_full.pdf"; 89 | String output = outputPath + "cleanPath_full.pdf"; 90 | String cmp = inputPath + "cmp_cleanPath_full.pdf"; 91 | 92 | cleanUp(input, output, null); 93 | compareByContent(cmp, output, outputPath, "diff_path_full"); 94 | } 95 | 96 | @Test 97 | public void cleanPathPartial() throws IOException, InterruptedException { 98 | String input = inputPath + "cleanPath_partial.pdf"; 99 | String output = outputPath + "cleanPath_partial.pdf"; 100 | String cmp = inputPath + "cmp_cleanPath_partial.pdf"; 101 | 102 | cleanUp(input, output, null); 103 | compareByContent(cmp, output, outputPath, "diff_path_partial"); 104 | } 105 | 106 | private void cleanUp(String input, String output, List cleanUpLocations) throws IOException { 107 | PdfDocument pdfDocument = new PdfDocument(new PdfReader(input), new PdfWriter(output)); 108 | 109 | if (cleanUpLocations == null) { 110 | PdfCleaner.cleanUpRedactAnnotations(pdfDocument); 111 | } else { 112 | PdfCleaner.cleanUp(pdfDocument, cleanUpLocations); 113 | } 114 | 115 | pdfDocument.close(); 116 | } 117 | 118 | private void compareByContent(String cmp, String output, String targetDir, String diffPrefix) throws IOException, InterruptedException { 119 | CompareTool cmpTool = new CompareTool(); 120 | String errorMessage = cmpTool.compareByContent(output, cmp, targetDir, diffPrefix + "_"); 121 | 122 | if (errorMessage != null) { 123 | Assertions.fail(errorMessage); 124 | } 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /src/test/java/com/itextpdf/pdfcleanup/PdfAutoSweepToolsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup; 24 | 25 | import com.itextpdf.kernel.colors.ColorConstants; 26 | import com.itextpdf.kernel.pdf.CompressionConstants; 27 | import com.itextpdf.kernel.pdf.PdfDocument; 28 | import com.itextpdf.kernel.pdf.PdfReader; 29 | import com.itextpdf.kernel.pdf.PdfWriter; 30 | import com.itextpdf.kernel.utils.CompareTool; 31 | import com.itextpdf.pdfcleanup.autosweep.CompositeCleanupStrategy; 32 | import com.itextpdf.pdfcleanup.autosweep.PdfAutoSweepTools; 33 | import com.itextpdf.pdfcleanup.autosweep.RegexBasedCleanupStrategy; 34 | import com.itextpdf.test.ExtendedITextTest; 35 | 36 | import java.io.ByteArrayOutputStream; 37 | import java.util.List; 38 | import org.junit.jupiter.api.Assertions; 39 | import org.junit.jupiter.api.BeforeAll; 40 | import org.junit.jupiter.api.Tag; 41 | import org.junit.jupiter.api.Test; 42 | 43 | import java.io.IOException; 44 | 45 | @Tag("IntegrationTest") 46 | public class PdfAutoSweepToolsTest extends ExtendedITextTest { 47 | 48 | private static final String INPUT_PATH = "./src/test/resources/com/itextpdf/pdfcleanup/PdfAutoSweepTest/"; 49 | private static final String OUTPUT_PATH = "./target/test/com/itextpdf/pdfcleanup/PdfAutoSweepTest/"; 50 | 51 | @BeforeAll 52 | public static void before() { 53 | createOrClearDestinationFolder(OUTPUT_PATH); 54 | } 55 | 56 | @Test 57 | public void tentativeCleanUpTest() throws IOException, InterruptedException { 58 | String input = INPUT_PATH + "Lipsum.pdf"; 59 | String output = OUTPUT_PATH + "tentativeCleanUp.pdf"; 60 | String cmp = INPUT_PATH + "cmp_tentativeCleanUp.pdf"; 61 | 62 | CompositeCleanupStrategy strategy = new CompositeCleanupStrategy(); 63 | strategy.add(new RegexBasedCleanupStrategy("(D|d)olor").setRedactionColor(ColorConstants.GREEN)); 64 | 65 | PdfDocument pdf = new PdfDocument(new PdfReader(input), new PdfWriter(output).setCompressionLevel(0)); 66 | 67 | // sweep 68 | PdfAutoSweepTools autoSweep = new PdfAutoSweepTools(strategy); 69 | autoSweep.tentativeCleanUp(pdf); 70 | 71 | pdf.close(); 72 | 73 | // compare 74 | compareByContent(cmp, output, OUTPUT_PATH, "diff_tentativeCleanUp_"); 75 | } 76 | 77 | @Test 78 | public void highlightTest() throws IOException, InterruptedException { 79 | String input = INPUT_PATH + "Lipsum.pdf"; 80 | String output = OUTPUT_PATH + "highlightTest.pdf"; 81 | String cmp = INPUT_PATH + "cmp_highlightTest.pdf"; 82 | 83 | CompositeCleanupStrategy strategy = new CompositeCleanupStrategy(); 84 | strategy.add(new RegexBasedCleanupStrategy("(D|d)olor").setRedactionColor(ColorConstants.GREEN)); 85 | 86 | PdfDocument pdf = new PdfDocument(new PdfReader(input), new PdfWriter(output) 87 | .setCompressionLevel(CompressionConstants.NO_COMPRESSION)); 88 | 89 | // sweep 90 | PdfAutoSweepTools autoSweep = new PdfAutoSweepTools(strategy); 91 | autoSweep.highlight(pdf); 92 | 93 | pdf.close(); 94 | 95 | // compare 96 | compareByContent(cmp, output, OUTPUT_PATH, "diff_highlightTest_"); 97 | } 98 | 99 | @Test 100 | public void getPdfCleanUpLocationsTest() throws IOException { 101 | String input = INPUT_PATH + "Lipsum.pdf"; 102 | 103 | CompositeCleanupStrategy strategy = new CompositeCleanupStrategy(); 104 | strategy.add(new RegexBasedCleanupStrategy("(D|d)olor")); 105 | 106 | PdfDocument pdf = new PdfDocument(new PdfReader(input), new PdfWriter(new ByteArrayOutputStream())); 107 | 108 | // sweep 109 | List cleanUpLocations = (List) new PdfAutoSweepTools(strategy).getPdfCleanUpLocations(pdf.getPage(1)); 110 | 111 | pdf.close(); 112 | 113 | // compare 114 | Assertions.assertEquals(2, cleanUpLocations.size()); 115 | } 116 | 117 | private void compareByContent(String cmp, String output, String targetDir, String diffPrefix) throws IOException, InterruptedException { 118 | CompareTool cmpTool = new CompareTool(); 119 | String errorMessage = cmpTool.compareByContent(output, cmp, targetDir, diffPrefix + "_"); 120 | 121 | if (errorMessage != null) { 122 | Assertions.fail(errorMessage); 123 | } 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /src/test/java/com/itextpdf/pdfcleanup/PdfCleanUpToolWithInlineImagesTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup; 24 | 25 | 26 | import com.itextpdf.io.logs.IoLogMessageConstant; 27 | import com.itextpdf.kernel.geom.Rectangle; 28 | import com.itextpdf.kernel.pdf.PdfDocument; 29 | import com.itextpdf.kernel.pdf.PdfReader; 30 | import com.itextpdf.kernel.pdf.PdfWriter; 31 | import com.itextpdf.kernel.utils.CompareTool; 32 | import com.itextpdf.pdfcleanup.util.CleanUpImagesCompareTool; 33 | import com.itextpdf.test.ExtendedITextTest; 34 | import com.itextpdf.test.annotations.LogMessage; 35 | import com.itextpdf.test.annotations.LogMessages; 36 | 37 | import org.junit.jupiter.api.Assertions; 38 | import org.junit.jupiter.api.BeforeAll; 39 | import org.junit.jupiter.api.Tag; 40 | import org.junit.jupiter.api.Test; 41 | 42 | import java.io.IOException; 43 | import java.util.Arrays; 44 | import java.util.List; 45 | 46 | @Tag("IntegrationTest") 47 | public class PdfCleanUpToolWithInlineImagesTest extends ExtendedITextTest { 48 | 49 | private static final String inputPath = "./src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolWithInlineImagesTest/"; 50 | private static final String outputPath = "./target/test/com/itextpdf/pdfcleanup/PdfCleanUpToolWithInlineImagesTest/"; 51 | 52 | @BeforeAll 53 | public static void before() { 54 | createOrClearDestinationFolder(outputPath); 55 | } 56 | 57 | @Test 58 | @LogMessages(messages = { 59 | @LogMessage(messageTemplate = IoLogMessageConstant.IMAGE_SIZE_CANNOT_BE_MORE_4KB) 60 | }) 61 | public void cleanUpTest28() throws IOException, InterruptedException { 62 | String input = inputPath + "inlineImages.pdf"; 63 | String output = outputPath + "inlineImages_partial.pdf"; 64 | String cmp = inputPath + "cmp_inlineImages_partial.pdf"; 65 | 66 | List cleanUpLocations = Arrays.asList(new PdfCleanUpLocation(1, new Rectangle(62, 100, 20, 800), null)); 67 | cleanUp(input, output, cleanUpLocations); 68 | compareByContent(cmp, output, outputPath, "diff_28"); 69 | } 70 | 71 | @Test 72 | public void cleanUpTest29() throws IOException, InterruptedException { 73 | String input = inputPath + "inlineImages.pdf"; 74 | String output = outputPath + "inlineImages_partial2.pdf"; 75 | String cmp = inputPath + "cmp_inlineImages_partial2.pdf"; 76 | 77 | List cleanUpLocations = Arrays.asList(new PdfCleanUpLocation(1, new Rectangle(10, 100, 70, 599), null)); 78 | cleanUp(input, output, cleanUpLocations); 79 | compareByContent(cmp, output, outputPath, "diff_29"); 80 | } 81 | 82 | @Test 83 | @LogMessages(messages = { 84 | @LogMessage(messageTemplate = IoLogMessageConstant.IMAGE_SIZE_CANNOT_BE_MORE_4KB) 85 | }) 86 | public void cleanUpTest31() throws IOException, InterruptedException { 87 | String input = inputPath + "inlineImageCleanup.pdf"; 88 | String output = outputPath + "inlineImageCleanup.pdf"; 89 | String cmp = inputPath + "cmp_inlineImageCleanup.pdf"; 90 | 91 | cleanUp(input, output, null); 92 | CleanUpImagesCompareTool cmpTool = new CleanUpImagesCompareTool(); 93 | String errorMessage = cmpTool.extractAndCompareImages(output, cmp, outputPath, "1"); 94 | String compareByContentResult = cmpTool.compareByContent(output, cmp, outputPath); 95 | if (compareByContentResult != null) { 96 | errorMessage += compareByContentResult; 97 | } 98 | 99 | if (!errorMessage.equals("")) { 100 | Assertions.fail(errorMessage); 101 | } 102 | } 103 | 104 | private void cleanUp(String input, String output, List cleanUpLocations) throws IOException { 105 | PdfDocument pdfDocument = new PdfDocument(new PdfReader(input), new PdfWriter(output)); 106 | 107 | if (cleanUpLocations == null) { 108 | PdfCleaner.cleanUpRedactAnnotations(pdfDocument); 109 | } else { 110 | PdfCleaner.cleanUp(pdfDocument, cleanUpLocations); 111 | } 112 | 113 | pdfDocument.close(); 114 | } 115 | 116 | private void compareByContent(String cmp, String output, String targetDir, String diffPrefix) throws IOException, InterruptedException { 117 | CompareTool cmpTool = new CompareTool(); 118 | String errorMessage = cmpTool.compareByContent(output, cmp, targetDir, diffPrefix + "_"); 119 | 120 | if (errorMessage != null) { 121 | Assertions.fail(errorMessage); 122 | } 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /src/test/java/com/itextpdf/pdfcleanup/RectangleTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup; 24 | 25 | import com.itextpdf.kernel.colors.DeviceRgb; 26 | import com.itextpdf.kernel.geom.Rectangle; 27 | import com.itextpdf.kernel.pdf.PdfDocument; 28 | import com.itextpdf.kernel.pdf.PdfPage; 29 | import com.itextpdf.kernel.pdf.PdfReader; 30 | import com.itextpdf.kernel.pdf.PdfWriter; 31 | import com.itextpdf.kernel.pdf.canvas.PdfCanvas; 32 | import com.itextpdf.kernel.utils.CompareTool; 33 | import com.itextpdf.test.ExtendedITextTest; 34 | 35 | import java.io.ByteArrayInputStream; 36 | import java.io.ByteArrayOutputStream; 37 | import java.io.IOException; 38 | import org.junit.jupiter.api.Assertions; 39 | import org.junit.jupiter.api.BeforeAll; 40 | import org.junit.jupiter.api.Tag; 41 | import org.junit.jupiter.api.Test; 42 | 43 | @Tag("IntegrationTest") 44 | public class RectangleTest extends ExtendedITextTest { 45 | 46 | private static final String SOURCE_FOLDER = "./src/test/resources/com/itextpdf/pdfcleanup/RectangleTest/"; 47 | private static final String DESTINATION_FOLDER = "./target/test/com/itextpdf/pdfcleanup/RectangleTest/"; 48 | 49 | @BeforeAll 50 | public static void beforeClass() 51 | { 52 | createDestinationFolder(DESTINATION_FOLDER); 53 | } 54 | 55 | @Test 56 | // TODO DEVSIX-7136 Red rectangle drawn with zero-width line does not disappear on sweeping 57 | public void zeroWidthLineTest() throws IOException, InterruptedException { 58 | String outPdf = DESTINATION_FOLDER + "zeroWidthLine.pdf"; 59 | String cmpPdf = SOURCE_FOLDER + "cmp_zeroWidthLine.pdf"; 60 | 61 | ByteArrayOutputStream outDocBaos = new ByteArrayOutputStream(); 62 | try (PdfDocument pdfDocument = new PdfDocument(new PdfWriter(outDocBaos))) { 63 | PdfPage page = pdfDocument.addNewPage(); 64 | PdfCanvas canvas = new PdfCanvas(page); 65 | 66 | canvas.setStrokeColor(DeviceRgb.BLUE) 67 | .setLineWidth(0) 68 | .rectangle(new Rectangle(350, 400, 100, 100)) 69 | .stroke(); 70 | canvas.setStrokeColor(DeviceRgb.RED) 71 | .setLineWidth(0) 72 | .moveTo(100, 100) 73 | .lineTo(100, 200) 74 | .lineTo(200, 200) 75 | .lineTo(200, 100) 76 | .closePath() 77 | .stroke(); 78 | } 79 | 80 | PdfDocument pdfDocument = new PdfDocument(new PdfReader(new ByteArrayInputStream(outDocBaos.toByteArray())), 81 | new PdfWriter(outPdf)); 82 | PdfCleanUpTool workingTool = new PdfCleanUpTool(pdfDocument); 83 | Rectangle area = new Rectangle(100, 150, 150, 150); 84 | //It's expected that upper half of red rectangle is cleaned up 85 | workingTool.addCleanupLocation(new PdfCleanUpLocation(1, area)); 86 | workingTool.cleanUp(); 87 | pdfDocument.close(); 88 | 89 | Assertions.assertNull(new CompareTool().compareByContent(outPdf, cmpPdf, DESTINATION_FOLDER, "diff_")); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/test/java/com/itextpdf/pdfcleanup/TextPositioningTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup; 24 | 25 | import com.itextpdf.io.font.constants.StandardFonts; 26 | import com.itextpdf.kernel.font.PdfFontFactory; 27 | import com.itextpdf.kernel.pdf.PdfArray; 28 | import com.itextpdf.kernel.pdf.PdfDocument; 29 | import com.itextpdf.kernel.pdf.PdfPage; 30 | import com.itextpdf.kernel.pdf.PdfWriter; 31 | import com.itextpdf.kernel.pdf.canvas.PdfCanvas; 32 | import com.itextpdf.test.ExtendedITextTest; 33 | 34 | import java.io.ByteArrayOutputStream; 35 | import java.io.IOException; 36 | import java.util.ArrayList; 37 | import org.junit.jupiter.api.Assertions; 38 | import org.junit.jupiter.api.Tag; 39 | import org.junit.jupiter.api.Test; 40 | 41 | @Tag("UnitTest") 42 | public class TextPositioningTest extends ExtendedITextTest { 43 | 44 | public static final float EPS = 0.0001F; 45 | 46 | @Test 47 | public void checkNoNpeThrowsInWritePositioningOperatorTest() throws IOException { 48 | PdfCanvas canvasForTest = createTestCanvas(1.0F); 49 | 50 | TextPositioning textPositioning = new TextPositioning(); 51 | try { 52 | textPositioning.appendPositioningOperator("T*", new ArrayList<>()); 53 | textPositioning 54 | .writePositionedText("T*", new ArrayList<>(), new PdfArray(), canvasForTest); 55 | } catch (NullPointerException nullPointerException) { 56 | Assertions.fail("We don't expect, that NPE will be thrown in this test!"); 57 | } 58 | Assertions.assertEquals(0.0, canvasForTest.getGraphicsState().getLeading(), EPS); 59 | } 60 | 61 | @Test 62 | public void checkNoNpeThrowsInWritePositioningTextTest() throws IOException { 63 | PdfCanvas canvasForTest = createTestCanvas(2.0F); 64 | 65 | TextPositioning textPositioning = new TextPositioning(); 66 | try { 67 | textPositioning.appendPositioningOperator("'", new ArrayList<>()); 68 | textPositioning.writePositionedText("'", new ArrayList<>(), new PdfArray(), canvasForTest); 69 | } catch (NullPointerException nullPointerException) { 70 | Assertions.fail("We don't expect, that NPE will be thrown in this test!"); 71 | } 72 | Assertions.assertEquals(0.0, canvasForTest.getGraphicsState().getLeading(), EPS); 73 | } 74 | 75 | private static PdfCanvas createTestCanvas(float canvasLeading) throws IOException { 76 | PdfDocument document = new PdfDocument(new PdfWriter(new ByteArrayOutputStream())); 77 | PdfPage documentPage = document.addNewPage(); 78 | PdfCanvas canvas = new PdfCanvas(documentPage); 79 | 80 | canvas.setLeading(canvasLeading); 81 | canvas.setFontAndSize(PdfFontFactory.createFont(StandardFonts.COURIER), 14); 82 | return canvas; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/test/java/com/itextpdf/pdfcleanup/images/CleanUpImageIndexedColorSpaceTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup.images; 24 | 25 | import com.itextpdf.kernel.geom.Rectangle; 26 | import com.itextpdf.kernel.pdf.PdfDocument; 27 | import com.itextpdf.kernel.pdf.PdfReader; 28 | import com.itextpdf.kernel.pdf.PdfWriter; 29 | import com.itextpdf.kernel.utils.CompareTool; 30 | import com.itextpdf.pdfcleanup.PdfCleanUpLocation; 31 | import com.itextpdf.pdfcleanup.PdfCleaner; 32 | import com.itextpdf.test.ExtendedITextTest; 33 | 34 | import java.util.Arrays; 35 | import org.junit.jupiter.api.Assertions; 36 | import org.junit.jupiter.api.BeforeAll; 37 | import org.junit.jupiter.api.Tag; 38 | import org.junit.jupiter.api.Test; 39 | 40 | @Tag("IntegrationTest") 41 | public class CleanUpImageIndexedColorSpaceTest extends ExtendedITextTest { 42 | 43 | private static final String inputPath = "./src/test/resources/com/itextpdf/pdfcleanup/images/CleanUpImageIndexedColorSpaceTest/"; 44 | private static final String outputPath = "./target/test/com/itextpdf/pdfcleanup/images/CleanUpImageIndexedColorSpaceTest/"; 45 | 46 | @BeforeAll 47 | public static void before() { 48 | createOrClearDestinationFolder(outputPath); 49 | } 50 | 51 | @Test 52 | public void noWhiteColorTest() throws Exception { 53 | String input = inputPath + "indexedImageNoWhite.pdf"; 54 | String output = outputPath + "indexedImageNoWhite.pdf"; 55 | String cmp = inputPath + "cmp_indexedImageNoWhite.pdf"; 56 | 57 | try (PdfDocument pdfDocument = new PdfDocument(new PdfReader(input), new PdfWriter(output))) { 58 | PdfCleaner.cleanUp(pdfDocument, 59 | Arrays.asList(new PdfCleanUpLocation(1, new Rectangle(150, 250, 100, 100))) 60 | ); 61 | } 62 | 63 | /* 64 | Result in Java and .NET is different. 65 | 66 | Java is able to process images with indexed colorspace same as others and 67 | doesn't preserve indexed colorspace. .NET requires special processing for 68 | indexed colorspace images, but preserves indexed colorspace. 69 | 70 | In .NET color of cleaned area is the first color of indexed color palette. 71 | In Java color of cleaned area is white. 72 | */ 73 | Assertions.assertNull(new CompareTool().compareByContent(output, cmp, outputPath)); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/test/java/com/itextpdf/pdfcleanup/images/CleanUpTransformedImageTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup.images; 24 | 25 | import com.itextpdf.kernel.colors.ColorConstants; 26 | import com.itextpdf.kernel.geom.Rectangle; 27 | import com.itextpdf.kernel.pdf.PdfDocument; 28 | import com.itextpdf.kernel.pdf.PdfReader; 29 | import com.itextpdf.kernel.pdf.PdfWriter; 30 | import com.itextpdf.kernel.pdf.canvas.PdfCanvas; 31 | import com.itextpdf.pdfcleanup.PdfCleanUpLocation; 32 | import com.itextpdf.pdfcleanup.PdfCleaner; 33 | import com.itextpdf.pdfcleanup.util.CleanUpImagesCompareTool; 34 | import com.itextpdf.test.ExtendedITextTest; 35 | 36 | import java.io.IOException; 37 | import java.util.Collections; 38 | import org.junit.jupiter.api.Assertions; 39 | import org.junit.jupiter.api.BeforeAll; 40 | import org.junit.jupiter.api.Tag; 41 | import org.junit.jupiter.api.Test; 42 | 43 | @Tag("IntegrationTest") 44 | public class CleanUpTransformedImageTest extends ExtendedITextTest { 45 | 46 | private static final String inputPath = "./src/test/resources/com/itextpdf/pdfcleanup/images/CleanUpTransformedImageTest/"; 47 | private static final String outputPath = "./target/test/com/itextpdf/pdfcleanup/images/CleanUpTransformedImageTest/"; 48 | 49 | 50 | @BeforeAll 51 | public static void before() { 52 | createOrClearDestinationFolder(outputPath); 53 | } 54 | 55 | @Test 56 | public void skewedGrayscaleImageBBoxCleanUpTest() throws Exception { 57 | // TODO DEVSIX-5089 skewed images cleanup is not supported 58 | String input = inputPath + "skewedGrayImage.pdf"; 59 | String output = outputPath + "skewedGrayImage.pdf"; 60 | String cmp = inputPath + "cmp_skewedGrayImage.pdf"; 61 | 62 | Rectangle cleanupRegion = new Rectangle(150, 250, 100, 100); 63 | 64 | Assertions.assertThrows(ArrayIndexOutOfBoundsException.class, () -> { 65 | cleanFirstPageAndDrawCleanupRegion(cleanupRegion, input, output); 66 | Assertions.assertNull(findDifferencesBetweenOutputAndCmp(output, cmp)); 67 | }); 68 | } 69 | 70 | @Test 71 | public void skewedRgbImageBBoxCleanUpTest() throws Exception { 72 | // TODO DEVSIX-5089 skewed images cleanup is not supported 73 | String input = inputPath + "skewedRgbImage.pdf"; 74 | String output = outputPath + "skewedRgbImage.pdf"; 75 | String cmp = inputPath + "cmp_skewedRgbImage.pdf"; 76 | 77 | Rectangle cleanupRegion = new Rectangle(150, 250, 100, 100); 78 | 79 | cleanFirstPageAndDrawCleanupRegion(cleanupRegion, input, output); 80 | Assertions.assertNull(findDifferencesBetweenOutputAndCmp(output, cmp)); 81 | } 82 | 83 | private static void cleanFirstPageAndDrawCleanupRegion(Rectangle cleanupRegion, String input, String output) throws IOException { 84 | try (PdfDocument pdfDocument = new PdfDocument(new PdfReader(input), new PdfWriter(output))) { 85 | PdfCleaner.cleanUp(pdfDocument, Collections.singletonList(new PdfCleanUpLocation(1, cleanupRegion))); 86 | 87 | drawCleanupRegionOnPage(pdfDocument, cleanupRegion); 88 | } 89 | } 90 | 91 | private static void drawCleanupRegionOnPage(PdfDocument pdfDocument, Rectangle cleanupRegion) { 92 | new PdfCanvas(pdfDocument.getFirstPage()) 93 | .setLineDash(3, 3).setStrokeColor(ColorConstants.CYAN) 94 | .rectangle(cleanupRegion).stroke(); 95 | } 96 | 97 | private static String findDifferencesBetweenOutputAndCmp(String output, String cmp) throws IOException, InterruptedException { 98 | CleanUpImagesCompareTool compareTool = new CleanUpImagesCompareTool(); 99 | String imgCompare = compareTool.extractAndCompareImages(output, cmp, outputPath); 100 | String contentCompare = compareTool.compareByContent(output, cmp, outputPath); 101 | return imgCompare.isEmpty() ? contentCompare : String.join("\n", imgCompare, contentCompare); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /src/test/java/com/itextpdf/pdfcleanup/images/CleanupImageWithColorSpaceTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup.images; 24 | 25 | 26 | import com.itextpdf.kernel.colors.ColorConstants; 27 | import com.itextpdf.kernel.geom.Rectangle; 28 | import com.itextpdf.kernel.pdf.PdfDocument; 29 | import com.itextpdf.kernel.pdf.PdfReader; 30 | import com.itextpdf.kernel.pdf.PdfWriter; 31 | import com.itextpdf.pdfcleanup.PdfCleaner; 32 | import com.itextpdf.pdfcleanup.util.CleanUpImagesCompareTool; 33 | import com.itextpdf.pdfcleanup.PdfCleanUpLocation; 34 | import com.itextpdf.test.ExtendedITextTest; 35 | 36 | import java.io.IOException; 37 | import java.util.Arrays; 38 | import java.util.List; 39 | 40 | import org.junit.jupiter.api.Assertions; 41 | import org.junit.jupiter.api.BeforeAll; 42 | import org.junit.jupiter.api.Tag; 43 | import org.junit.jupiter.api.Test; 44 | 45 | 46 | @Tag("IntegrationTest") 47 | public class CleanupImageWithColorSpaceTest extends ExtendedITextTest { 48 | 49 | private static final String inputPath = "./src/test/resources/com/itextpdf/pdfcleanup/images/CleanupImageWithColorSpaceTest/"; 50 | private static final String outputPath = "./target/test/com/itextpdf/pdfcleanup/images/CleanupImageWithColorSpaceTest/"; 51 | 52 | 53 | @BeforeAll 54 | public static void before() { 55 | createOrClearDestinationFolder(outputPath); 56 | } 57 | 58 | @Test 59 | public void cleanUpTestColorSpace() throws Exception { 60 | String input = inputPath + "imgSeparationCs.pdf"; 61 | String output = outputPath + "imgSeparationCs.pdf"; 62 | String cmp = inputPath + "cmp_imgSeparationCs.pdf"; 63 | 64 | cleanUp(input, output, 65 | Arrays.asList(new PdfCleanUpLocation(1, new Rectangle(60f, 780f, 60f, 45f), ColorConstants.GREEN))); 66 | compareByContent(cmp, output, outputPath, "9"); 67 | } 68 | 69 | @Test 70 | public void cleanUpTestColorSpaceJpegBaselineEncoded() throws Exception { 71 | // cleanup jpeg image with baseline encoded data 72 | String input = inputPath + "imgSeparationCsJpegBaselineEncoded.pdf"; 73 | String output = outputPath + "imgSeparationCsJpegBaselineEncoded.pdf"; 74 | String cmp = inputPath + "cmp_imgSeparationCsJpegBaselineEncoded.pdf"; 75 | 76 | cleanUp(input, output, 77 | Arrays.asList(new PdfCleanUpLocation(1, new Rectangle(60f, 600f, 100f, 50f), ColorConstants.GREEN))); 78 | compareByContent(cmp, output, outputPath, "11"); 79 | } 80 | 81 | @Test 82 | public void cleanUpTestColorSpaceJpegBaselineEncodedWithApp14Segment() throws Exception { 83 | // cleanup jpeg image with baseline encoded data and app14 segment with unknown color type 84 | // Adobe Photoshop will always add an APP14 segment into the resulting jpeg file. 85 | // To make Unknown color type we have set the quality of an image to maximum during the "save as" operation 86 | String input = inputPath + "imgSeparationCsJpegBaselineEncodedWithApp14Segment.pdf"; 87 | String output = outputPath + "imgSeparationCsJpegBaselineEncodedWithApp14Segment.pdf"; 88 | String cmp = inputPath + "cmp_imgSeparationCsJpegBaselineEncodedWithApp14Segment.pdf"; 89 | 90 | cleanUp(input, output, 91 | Arrays.asList(new PdfCleanUpLocation(1, new Rectangle(60f, 600f, 100f, 50f), ColorConstants.GREEN))); 92 | compareByContent(cmp, output, outputPath, "10"); 93 | } 94 | 95 | private void cleanUp(String input, String output, List cleanUpLocations) throws IOException { 96 | PdfDocument pdfDocument = new PdfDocument(new PdfReader(input), new PdfWriter(output)); 97 | 98 | if (cleanUpLocations == null) { 99 | PdfCleaner.cleanUpRedactAnnotations(pdfDocument); 100 | } else { 101 | PdfCleaner.cleanUp(pdfDocument, cleanUpLocations); 102 | } 103 | 104 | pdfDocument.close(); 105 | } 106 | 107 | private void compareByContent(String cmp, String output, String targetDir, String fuzzValue) 108 | throws IOException, InterruptedException { 109 | CleanUpImagesCompareTool cmpTool = new CleanUpImagesCompareTool(); 110 | cmpTool.useGsImageExtracting(true); 111 | String errorMessage = cmpTool.extractAndCompareImages(output, cmp, targetDir, fuzzValue); 112 | String compareByContentResult = cmpTool.compareByContent(output, cmp, targetDir); 113 | if (compareByContentResult != null) { 114 | errorMessage += compareByContentResult; 115 | } 116 | 117 | if (!errorMessage.equals("")) { 118 | Assertions.fail(errorMessage); 119 | } 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /src/test/java/com/itextpdf/pdfcleanup/text/CleanUpTextTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the iText (R) project. 3 | Copyright (c) 1998-2025 Apryse Group NV 4 | Authors: Apryse Software. 5 | 6 | This program is offered under a commercial and under the AGPL license. 7 | For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. 8 | 9 | AGPL licensing: 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Affero General Public License for more details. 19 | 20 | You should have received a copy of the GNU Affero General Public License 21 | along with this program. If not, see . 22 | */ 23 | package com.itextpdf.pdfcleanup.text; 24 | 25 | import com.itextpdf.io.logs.IoLogMessageConstant; 26 | import com.itextpdf.kernel.geom.Rectangle; 27 | import com.itextpdf.kernel.pdf.PdfDocument; 28 | import com.itextpdf.kernel.pdf.PdfReader; 29 | import com.itextpdf.kernel.pdf.PdfWriter; 30 | import com.itextpdf.kernel.utils.CompareTool; 31 | import com.itextpdf.pdfcleanup.PdfCleanUpLocation; 32 | import com.itextpdf.pdfcleanup.PdfCleaner; 33 | import com.itextpdf.test.ExtendedITextTest; 34 | import com.itextpdf.test.annotations.LogMessage; 35 | import com.itextpdf.test.annotations.LogMessages; 36 | import java.io.IOException; 37 | import java.util.Arrays; 38 | import java.util.List; 39 | import org.junit.jupiter.api.Assertions; 40 | import org.junit.jupiter.api.BeforeAll; 41 | import org.junit.jupiter.api.Tag; 42 | import org.junit.jupiter.api.Test; 43 | 44 | @Tag("IntegrationTest") 45 | public class CleanUpTextTest extends ExtendedITextTest{ 46 | private static final String inputPath = "./src/test/resources/com/itextpdf/pdfcleanup/text/CleanUpTextTest/"; 47 | private static final String outputPath = "./target/test/com/itextpdf/pdfcleanup/text/CleanUpTextTest/"; 48 | 49 | @BeforeAll 50 | public static void before() { 51 | createOrClearDestinationFolder(outputPath); 52 | } 53 | 54 | @Test 55 | @LogMessages(messages = { 56 | @LogMessage(messageTemplate = IoLogMessageConstant.FONT_DICTIONARY_WITH_NO_FONT_DESCRIPTOR), 57 | @LogMessage(messageTemplate = IoLogMessageConstant.FONT_DICTIONARY_WITH_NO_WIDTHS)}) 58 | public void cleanZeroWidthTextInvalidFont() throws IOException, InterruptedException { 59 | String input = inputPath + "cleanZeroWidthTextInvalidFont.pdf"; 60 | String output = outputPath + "cleanZeroWidthTextInvalidFont.pdf"; 61 | String cmp = inputPath + "cmp_cleanZeroWidthTextInvalidFont.pdf"; 62 | 63 | cleanUp(input, output, Arrays.asList(new PdfCleanUpLocation(1, new Rectangle(50, 50, 500, 500)))); 64 | compareByContent(cmp, output, outputPath); 65 | } 66 | 67 | private void cleanUp(String input, String output, List cleanUpLocations) throws IOException { 68 | PdfDocument pdfDocument = new PdfDocument(new PdfReader(input), new PdfWriter(output)); 69 | 70 | if (cleanUpLocations == null) { 71 | PdfCleaner.cleanUpRedactAnnotations(pdfDocument); 72 | } else { 73 | PdfCleaner.cleanUp(pdfDocument, cleanUpLocations); 74 | } 75 | 76 | pdfDocument.close(); 77 | } 78 | 79 | private void compareByContent(String cmp, String output, String targetDir) throws IOException, InterruptedException { 80 | CompareTool cmpTool = new CompareTool(); 81 | String errorMessage = cmpTool.compareByContent(output, cmp, targetDir); 82 | 83 | if (errorMessage != null) { 84 | Assertions.fail(errorMessage); 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/BigDocumentAutoCleanUpTest/TheSopranos.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/BigDocumentAutoCleanUpTest/TheSopranos.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/BigDocumentAutoCleanUpTest/cleanUpAreaCalculationPrecision.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/BigDocumentAutoCleanUpTest/cleanUpAreaCalculationPrecision.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/BigDocumentAutoCleanUpTest/cmp_cleanUpAreaCalculationPrecision.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/BigDocumentAutoCleanUpTest/cmp_cleanUpAreaCalculationPrecision.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/BigDocumentAutoCleanUpTest/cmp_redactIPhoneUserManual.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/BigDocumentAutoCleanUpTest/cmp_redactIPhoneUserManual.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/BigDocumentAutoCleanUpTest/cmp_redactIPhoneUserManualColored.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/BigDocumentAutoCleanUpTest/cmp_redactIPhoneUserManualColored.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/BigDocumentAutoCleanUpTest/cmp_redactIPhoneUserManualMatchColor.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/BigDocumentAutoCleanUpTest/cmp_redactIPhoneUserManualMatchColor.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/BigDocumentAutoCleanUpTest/cmp_redactTonySoprano.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/BigDocumentAutoCleanUpTest/cmp_redactTonySoprano.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/BigDocumentAutoCleanUpTest/iphone_user_guide_untagged.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/BigDocumentAutoCleanUpTest/iphone_user_guide_untagged.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/BigDocumentAutoCleanUpTest/iphone_user_guide_untagged_small.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/BigDocumentAutoCleanUpTest/iphone_user_guide_untagged_small.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/BigDocumentCleanUpTest/chapter8_Interactive_features.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/BigDocumentCleanUpTest/chapter8_Interactive_features.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/BigDocumentCleanUpTest/cmp_bigTaggedDocument.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/BigDocumentCleanUpTest/cmp_bigTaggedDocument.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/BigDocumentCleanUpTest/cmp_bigUntaggedDocument.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/BigDocumentCleanUpTest/cmp_bigUntaggedDocument.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/BigDocumentCleanUpTest/cmp_redactIPhoneUserManualMatchColor.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/BigDocumentCleanUpTest/cmp_redactIPhoneUserManualMatchColor.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/BigDocumentCleanUpTest/cmp_textPositioning.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/BigDocumentCleanUpTest/cmp_textPositioning.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/BigDocumentCleanUpTest/iphone_user_guide_untagged.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/BigDocumentCleanUpTest/iphone_user_guide_untagged.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/BigDocumentCleanUpTest/textPositioning.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/BigDocumentCleanUpTest/textPositioning.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cleanAnnotation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cleanAnnotation.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_cleanAnnotation_Line01.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_cleanAnnotation_Line01.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_cleanAnnotation_Link01.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_cleanAnnotation_Link01.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_cleanAnnotation_Text01.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_cleanAnnotation_Text01.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_cleanAnnotation_full01.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_cleanAnnotation_full01.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_cleanAnnotation_highlight01.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_cleanAnnotation_highlight01.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_cleanFreeTextAnnotation01.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_cleanFreeTextAnnotation01.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_cleanLineAnnotation02.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_cleanLineAnnotation02.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_cleanStrikeOutAnnotation01.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_cleanStrikeOutAnnotation01.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_cleanStrikeOutAnnotation02.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_cleanStrikeOutAnnotation02.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_formAnnotation01.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_formAnnotation01.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_formAnnotation02.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_formAnnotation02.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_watermarkAnnotation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/cmp_watermarkAnnotation.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/formAnnotation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/formAnnotation.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/freeTextAnnotation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/freeTextAnnotation.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/lineAnnotationLeaders.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/lineAnnotationLeaders.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/strikeOutAnnotQuadOutsideRect.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/strikeOutAnnotQuadOutsideRect.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/watermarkAnnotation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpAnnotationTest/watermarkAnnotation.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpInvalidPdfTest/circularReferencesInResources.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpInvalidPdfTest/circularReferencesInResources.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cleanImage_full.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cleanImage_full.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cleanImage_partial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cleanImage_partial.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cleanPath_full.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cleanPath_full.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cleanPath_partial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cleanPath_partial.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cleanText_full.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cleanText_full.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cleanText_partial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cleanText_partial.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cmp_cleanImage_full.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cmp_cleanImage_full.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cmp_cleanImage_partial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cmp_cleanImage_partial.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cmp_cleanPath_full.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cmp_cleanPath_full.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cmp_cleanPath_partial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cmp_cleanPath_partial.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cmp_cleanText_full.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cmp_cleanText_full.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cmp_cleanText_partial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanUpTaggedPdfTest/cmp_cleanText_partial.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/CleanupImageHandlingUtilTest/cleanUpImageEmptyAreasToClean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/CleanupImageHandlingUtilTest/cleanUpImageEmptyAreasToClean.png -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/cmp_filteredImagesCacheFlushingTest01.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/cmp_filteredImagesCacheFlushingTest01.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/cmp_filteredImagesCacheFlushingTest02.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/cmp_filteredImagesCacheFlushingTest02.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/cmp_filteredImagesCacheTest01.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/cmp_filteredImagesCacheTest01.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/cmp_filteredImagesCacheTest02.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/cmp_filteredImagesCacheTest02.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/cmp_filteredImagesCacheTest03.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/cmp_filteredImagesCacheTest03.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/cmp_filteredImagesCacheTest04.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/cmp_filteredImagesCacheTest04.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/itis.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/itis.jpg -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/itis2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/itis2.jpg -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/multipleDifferentImageXObjectOccurrences.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/multipleDifferentImageXObjectOccurrences.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/multipleImageXObjectOccurrences.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/multipleImageXObjectOccurrences.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/multipleScaledImageXObjectOccurrences.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/multipleScaledImageXObjectOccurrences.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/severalImageXObjectOccurrences.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/FilteredImagesCacheTest/severalImageXObjectOccurrences.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_.000_redact.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_.000_redact.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_.001_redact.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_.001_redact.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_.100_redact.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_.100_redact.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_.200_redact.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_.200_redact.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_.300_redact.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_.300_redact.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_.400_redact.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_.400_redact.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_.500_redact.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_.500_redact.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_.600_redact.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_.600_redact.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_.700_redact.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_.700_redact.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_.800_redact.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_.800_redact.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_.900_redact.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_.900_redact.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_1.000_redact.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_differentTextRenderInfo_1.000_redact.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_redact_aspect_ratio_0_simple.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_redact_aspect_ratio_0_simple.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_redact_aspect_ratio_1_simple.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_redact_aspect_ratio_1_simple.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_redact_aspect_ratio_simple.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_redact_aspect_ratio_simple.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_wo_redact_aspect_ratio_simple.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/cmp_wo_redact_aspect_ratio_simple.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/differentTextRenderInfo.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/differentTextRenderInfo.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/redact_aspect_ratio_simple.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/OverlapRatioTest/redact_aspect_ratio_simple.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfAutoSweepTest/Lipsum.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfAutoSweepTest/Lipsum.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfAutoSweepTest/cmp_highlightTest.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfAutoSweepTest/cmp_highlightTest.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfAutoSweepTest/cmp_lineArtsDrawingOnCanvas.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfAutoSweepTest/cmp_lineArtsDrawingOnCanvas.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfAutoSweepTest/cmp_tentativeCleanUp.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfAutoSweepTest/cmp_tentativeCleanUp.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfAutoSweepTest/lineArtsDrawingOnCanvas.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfAutoSweepTest/lineArtsDrawingOnCanvas.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfAutoSweepTest/noninvertibleMatrix.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfAutoSweepTest/noninvertibleMatrix.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/BigImage-jpg.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/BigImage-jpg.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/BigImage-png.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/BigImage-png.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/BigImage-tif-lzw.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/BigImage-tif-lzw.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/BigImage-tif.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/BigImage-tif.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/DirectPropertyObject.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/DirectPropertyObject.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/Lipsum.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/Lipsum.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/absentICentry.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/absentICentry.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/bigOne.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/bigOne.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/clipPathReduction.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/clipPathReduction.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/clippingNWRule.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/clippingNWRule.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/closedBezier.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/closedBezier.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_BigImage-jpg.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_BigImage-jpg.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_BigImage-png.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_BigImage-png.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_BigImage-tif-lzw.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_BigImage-tif-lzw.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_BigImage-tif.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_BigImage-tif.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_DirectPropertyObject.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_DirectPropertyObject.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_absentICentry.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_absentICentry.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_autoCleanPageTest.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_autoCleanPageTest.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_autoCleanPageWithAdditionalLocationAndPropertyTest.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_autoCleanPageWithAdditionalLocationAndPropertyTest.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_autoCleanPageWithAdditionalLocationTest.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_autoCleanPageWithAdditionalLocationTest.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_autoCleanWithCleaUpPropertiesTest.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_autoCleanWithCleaUpPropertiesTest.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_autoCleanWithFalseProcessAnnotationTest.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_autoCleanWithFalseProcessAnnotationTest.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_autoCleanWithLocationAndStreamParamsTest.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_autoCleanWithLocationAndStreamParamsTest.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_autoSweepCleanUpWithAdditionalLocationTest.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_autoSweepCleanUpWithAdditionalLocationTest.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_bigOne.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_bigOne.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_cleanUpDocument.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_cleanUpDocument.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_cleanUpPage.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_cleanUpPage.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_cleanUpStreamParamsTest.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_cleanUpStreamParamsTest.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_clipPathReduction.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_clipPathReduction.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_clippingNWRule.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_clippingNWRule.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_closedBezier.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_closedBezier.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_complexTextPositioning.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_complexTextPositioning.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_corruptJpeg.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_corruptJpeg.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_dashedBezier.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_dashedBezier.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_dashedClosedRotatedTriangles.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_dashedClosedRotatedTriangles.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_dashedStyledClosedBezier.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_dashedStyledClosedBezier.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_degenerateCases.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_degenerateCases.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_emptyPdf.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_emptyPdf.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_emptyTj01.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_emptyTj01.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_emptyTj02.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_emptyTj02.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_fontCleanup.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_fontCleanup.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_fullyFilteredImageDocument.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_fullyFilteredImageDocument.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_helloHelvetica.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_helloHelvetica.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_helloHelvetica02.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_helloHelvetica02.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_hello_05.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_hello_05.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_incorrectBDCToBMCTest.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_incorrectBDCToBMCTest.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_inlineImages_full.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_inlineImages_full.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_lineArtsCompletely.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_lineArtsCompletely.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_lineArtsPartially.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_lineArtsPartially.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_lineArtsSimple.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_lineArtsSimple.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_line_chart.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_line_chart.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_lotOfDashes.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_lotOfDashes.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_maskImage.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_maskImage.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_miterTest.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_miterTest.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_multiUseImage.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_multiUseImage.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_multiUseIndirect.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_multiUseIndirect.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_newLines01.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_newLines01.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_newLines02.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_newLines02.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_newLines03.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_newLines03.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_noPropertiesInResourcesTest.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_noPropertiesInResourcesTest.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_noninvertibleMatrix.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_noninvertibleMatrix.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_noninvertibleMatrixRemoveAllTest.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_noninvertibleMatrixRemoveAllTest.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_noninvertibleMatrixRemoveAllTest02.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_noninvertibleMatrixRemoveAllTest02.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_noninvertibleMatrixRemoveNothingTest.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_noninvertibleMatrixRemoveNothingTest.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_page166_03.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_page166_03.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_page166_04.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_page166_04.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_page229-modified-Tc-Tw.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_page229-modified-Tc-Tw.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_page229_01.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_page229_01.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_pathAndIncorrectCM.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_pathAndIncorrectCM.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_redactLipsumPatternStartsWithWhitespace.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_redactLipsumPatternStartsWithWhitespace.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_redactPdfWithNoninvertibleMatrix.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_redactPdfWithNoninvertibleMatrix.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_rotatedImg.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_rotatedImg.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_simpleCleanUpOnRotatedPages.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_simpleCleanUpOnRotatedPages.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_simpleCleanUpOnRotatedPagesIgnoreRotation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_simpleCleanUpOnRotatedPagesIgnoreRotation.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_simpleImmediate-tm.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_simpleImmediate-tm.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_simpleImmediate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_simpleImmediate.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_styledLineArts.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_styledLineArts.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_textAndImages.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_textAndImages.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_wholePageCleanUp.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/cmp_wholePageCleanUp.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/corruptJpeg.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/corruptJpeg.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/dashedBezier.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/dashedBezier.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/dashedClosedRotatedTriangles.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/dashedClosedRotatedTriangles.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/dashedStyledClosedBezier.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/dashedStyledClosedBezier.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/degenerateCases.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/degenerateCases.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/documentWithRotatedPages.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/documentWithRotatedPages.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/emptyPdf.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/emptyPdf.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/emptyTj01.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/emptyTj01.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/emptyTj02.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/emptyTj02.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/fontCleanup.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/fontCleanup.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/fullyFilteredImageDocument.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/fullyFilteredImageDocument.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/helloHelvetica.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/helloHelvetica.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/helloHelvetica02.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/helloHelvetica02.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/hello_05.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/hello_05.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/incorrectBDCToBMCTest.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/incorrectBDCToBMCTest.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/inlineImages.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/inlineImages.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/lineArtsCompletely.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/lineArtsCompletely.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/lineArtsPartially.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/lineArtsPartially.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/lineArtsSimple.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/lineArtsSimple.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/line_chart.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/line_chart.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/lotOfDashes.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/lotOfDashes.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/maskImage.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/maskImage.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/miterTest.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/miterTest.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/multiUseImage.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/multiUseImage.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/multiUseIndirect.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/multiUseIndirect.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/newLines01.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/newLines01.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/newLines02.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/newLines02.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/newLines03.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/newLines03.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/new_york_times.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/new_york_times.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/noPropertiesInResourcesTest.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/noPropertiesInResourcesTest.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/noninvertibleMatrix.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/noninvertibleMatrix.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/page166_03.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/page166_03.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/page166_04.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/page166_04.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/page229-modified-Tc-Tw.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/page229-modified-Tc-Tw.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/page229.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/page229.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/pathAndIncorrectCM.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/pathAndIncorrectCM.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/rotatedImg.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/rotatedImg.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/simpleImmediate-tm.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/simpleImmediate-tm.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/simpleImmediate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/simpleImmediate.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/styledLineArts.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/styledLineArts.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/viewer_prefs_dict_table.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolTest/viewer_prefs_dict_table.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolWithInlineImagesTest/cmp_inlineImageCleanup.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolWithInlineImagesTest/cmp_inlineImageCleanup.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolWithInlineImagesTest/cmp_inlineImages_partial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolWithInlineImagesTest/cmp_inlineImages_partial.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolWithInlineImagesTest/cmp_inlineImages_partial2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolWithInlineImagesTest/cmp_inlineImages_partial2.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolWithInlineImagesTest/inlineImageCleanup.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolWithInlineImagesTest/inlineImageCleanup.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolWithInlineImagesTest/inlineImages.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/PdfCleanUpToolWithInlineImagesTest/inlineImages.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/RectangleTest/cmp_zeroWidthLine.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/RectangleTest/cmp_zeroWidthLine.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/UnsupportedImageTypeTest/JpegCmykImage.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/UnsupportedImageTypeTest/JpegCmykImage.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/UnsupportedImageTypeTest/cmp_JpegCmykImage.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/UnsupportedImageTypeTest/cmp_JpegCmykImage.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/images/CleanUpImageIndexedColorSpaceTest/cmp_indexedImageNoWhite.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/images/CleanUpImageIndexedColorSpaceTest/cmp_indexedImageNoWhite.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/images/CleanUpImageIndexedColorSpaceTest/indexedImageNoWhite.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/images/CleanUpImageIndexedColorSpaceTest/indexedImageNoWhite.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/images/CleanUpTransformedImageTest/cmp_skewedRgbImage.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/images/CleanUpTransformedImageTest/cmp_skewedRgbImage.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/images/CleanUpTransformedImageTest/skewedGrayImage.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/images/CleanUpTransformedImageTest/skewedGrayImage.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/images/CleanUpTransformedImageTest/skewedRgbImage.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/images/CleanUpTransformedImageTest/skewedRgbImage.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/images/CleanupImageWithColorSpaceTest/cmp_imgSeparationCs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/images/CleanupImageWithColorSpaceTest/cmp_imgSeparationCs.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/images/CleanupImageWithColorSpaceTest/cmp_imgSeparationCsJpegBaselineEncoded.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/images/CleanupImageWithColorSpaceTest/cmp_imgSeparationCsJpegBaselineEncoded.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/images/CleanupImageWithColorSpaceTest/cmp_imgSeparationCsJpegBaselineEncodedWithApp14Segment.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/images/CleanupImageWithColorSpaceTest/cmp_imgSeparationCsJpegBaselineEncodedWithApp14Segment.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/images/CleanupImageWithColorSpaceTest/imgSeparationCs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/images/CleanupImageWithColorSpaceTest/imgSeparationCs.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/images/CleanupImageWithColorSpaceTest/imgSeparationCsJpegBaselineEncoded.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/images/CleanupImageWithColorSpaceTest/imgSeparationCsJpegBaselineEncoded.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/images/CleanupImageWithColorSpaceTest/imgSeparationCsJpegBaselineEncodedWithApp14Segment.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/images/CleanupImageWithColorSpaceTest/imgSeparationCsJpegBaselineEncodedWithApp14Segment.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/text/CleanUpTextTest/cleanZeroWidthTextInvalidFont.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/text/CleanUpTextTest/cleanZeroWidthTextInvalidFont.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/text/CleanUpTextTest/cmp_cleanZeroWidthTextInvalidFont.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/text/CleanUpTextTest/cmp_cleanZeroWidthTextInvalidFont.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/cmp_imageColorKeyMaskArray.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/cmp_imageColorKeyMaskArray.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/cmp_imageIsMask.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/cmp_imageIsMask.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/cmp_imageMask.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/cmp_imageMask.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/cmp_imageSMask.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/cmp_imageSMask.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/cmp_imageSMaskAIS.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/cmp_imageSMaskAIS.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/cmp_textOnTransparentField.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/cmp_textOnTransparentField.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/imageColorKeyMaskArray.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/imageColorKeyMaskArray.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/imageIsMask.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/imageIsMask.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/imageMask.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/imageMask.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/imageSMask.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/imageSMask.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/imageSMaskAIS.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/imageSMaskAIS.pdf -------------------------------------------------------------------------------- /src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/textOnTransparentField.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itext/itext-pdfsweep-java/0e9847ba94d48f00c812eeef681c48f3dedb358d/src/test/resources/com/itextpdf/pdfcleanup/transparency/MaskedImagesTest/textOnTransparentField.pdf --------------------------------------------------------------------------------