Skip to content

Commit 3a76a8d

Browse files
committed
[RELEASE] iText pdfSweep 5.0.0
2 parents 12c5a52 + f0cdbe7 commit 3a76a8d

21 files changed

+440
-108
lines changed

SECURITY.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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 [[email protected]]([email protected]). 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+
24+
## Known Vulnerabilities
25+
26+
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.
27+
28+
## Supported product lines
29+
30+
See [Compatibility Matrix](https://kb.itextpdf.com/itext/compatibility-matrix)
31+
32+
## Security Best Practices
33+
34+
To help ensure the security of your applications using pdfSweep, we recommend the following best practices:
35+
36+
1. **Keep pdfSweep up to date** by regularly checking for and applying updates.
37+
2. **Review and follow** our security guidelines for secure usage.
38+
3. **Monitor your applications** for any unusual activity and investigate any anomalies promptly.
39+
40+
Thank you for helping us keep iText secure!

doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
3232
# title of most generated pages and in a few other places.
3333
# The default value is: My Project.
3434

35-
PROJECT_NAME = "pdfSweep 4.0.3 API"
35+
PROJECT_NAME = "pdfSweep 5.0.0 API"
3636

3737
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
3838
# could be handy for archiving the generated documentation or if some version

itext.tests/itext.cleanup.tests/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
[assembly: Guid("647c862e-d837-4901-8e7b-68f5f8bf8f34")]
1717

18-
[assembly: AssemblyVersion("4.0.3.0")]
19-
[assembly: AssemblyFileVersion("4.0.3.0")]
20-
[assembly: AssemblyInformationalVersion("4.0.3")]
18+
[assembly: AssemblyVersion("5.0.0.0")]
19+
[assembly: AssemblyFileVersion("5.0.0.0")]
20+
[assembly: AssemblyInformationalVersion("5.0.0")]
2121

2222
[assembly: NUnit.Framework.Timeout(300000)]

itext.tests/itext.cleanup.tests/itext.cleanup.tests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@
3939
</ItemGroup>
4040
<ItemGroup>
4141
<ProjectReference Include="..\..\..\itextcore\itext\itext.io\itext.io.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.io\itext.io.csproj')" />
42-
<PackageReference Include="itext" Version="8.0.5" Condition="!Exists('..\..\..\itextcore\itext\itext.io\itext.io.csproj')" />
42+
<PackageReference Include="itext" Version="9.0.0" Condition="!Exists('..\..\..\itextcore\itext\itext.io\itext.io.csproj')" />
4343
<ProjectReference Include="..\..\..\itextcore\itext\itext.kernel\itext.kernel.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.kernel\itext.kernel.csproj')" />
4444
<ProjectReference Include="..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.csproj')" />
45-
<PackageReference Include="itext.pdftest" Version="8.0.5" Condition="!Exists('..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.csproj')" />
45+
<PackageReference Include="itext.pdftest" Version="9.0.0" Condition="!Exists('..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.csproj')" />
4646
<ProjectReference Include="..\..\..\itextcore\itext\itext.bouncy-castle-adapter\itext.bouncy-castle-adapter.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.bouncy-castle-adapter\itext.bouncy-castle-adapter.csproj')" />
47-
<PackageReference Include="itext.bouncy-castle-adapter" Version="8.0.5" Condition="!Exists('..\..\..\itextcore\itext\itext.bouncy-castle-adapter\itext.bouncy-castle-adapter.csproj')" />
47+
<PackageReference Include="itext.bouncy-castle-adapter" Version="9.0.0" Condition="!Exists('..\..\..\itextcore\itext\itext.bouncy-castle-adapter\itext.bouncy-castle-adapter.csproj')" />
4848

4949
<ProjectReference Include="..\..\itext\itext.cleanup\itext.cleanup.csproj" />
5050
</ItemGroup>

itext.tests/itext.cleanup.tests/itext/pdfcleanup/BigDocumentCleanUpTest.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,21 @@ public virtual void BigTaggedDocument() {
6565
CompareByContent(cmp, output, outputPath, "4");
6666
}
6767

68+
[NUnit.Framework.Test]
69+
[LogMessage(iText.IO.Logs.IoLogMessageConstant.CREATED_ROOT_TAG_HAS_MAPPING)]
70+
public virtual void BigTaggedDocumentDynamicOffsetMultiplier() {
71+
String input = inputPath + "chapter8_Interactive_features.pdf";
72+
String output = outputPath + "bigTaggedDocumentDynamicOffsetMultiplier.pdf";
73+
String cmp = inputPath + "cmp_bigTaggedDocument.pdf";
74+
IList<Rectangle> rects = JavaUtil.ArraysAsList(new Rectangle(60f, 80f, 460f, 65f), new Rectangle(300f, 370f
75+
, 215f, 270f));
76+
using (PdfDocument pdfDocument = new PdfDocument(new PdfReader(input), new PdfWriter(output))) {
77+
PdfCleaner.CleanUp(pdfDocument, InitLocations(rects, 131), new CleanUpProperties().SetOffsetProperties(new
78+
PathOffsetApproximationProperties().CalculateOffsetMultiplierDynamically(true)));
79+
}
80+
CompareByContent(cmp, output, outputPath, "4");
81+
}
82+
6883
[NUnit.Framework.Test]
6984
public virtual void TextPositioning() {
7085
String input = inputPath + "textPositioning.pdf";

itext.tests/itext.cleanup.tests/itext/pdfcleanup/CleanUpPropertiesUnitTest.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,15 @@ public virtual void SettingAspectRatioToNullIsOk() {
8181
properties.SetOverlapRatio(null);
8282
NUnit.Framework.Assert.IsNull(properties.GetOverlapRatio());
8383
}
84+
85+
[NUnit.Framework.Test]
86+
public virtual void SetGetPathOffsetApproximationPropertiesTest() {
87+
PathOffsetApproximationProperties pathOffsetApproximationProperties = new PathOffsetApproximationProperties
88+
().CalculateOffsetMultiplierDynamically(true).SetArcTolerance(0.0015);
89+
CleanUpProperties properties = new CleanUpProperties().SetOffsetProperties(pathOffsetApproximationProperties
90+
);
91+
NUnit.Framework.Assert.IsTrue(properties.GetOffsetProperties().CalculateOffsetMultiplierDynamically());
92+
NUnit.Framework.Assert.AreEqual(0.0015, properties.GetOffsetProperties().GetArcTolerance());
93+
}
8494
}
8595
}

itext.tests/itext.cleanup.tests/itext/pdfcleanup/PdfCleanUpFilterUnitTest.cs

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,86 @@ You should have received a copy of the GNU Affero General Public License
2727
namespace iText.PdfCleanup {
2828
[NUnit.Framework.Category("UnitTest")]
2929
public class PdfCleanUpFilterUnitTest : ExtendedITextTest {
30+
[NUnit.Framework.Test]
31+
public virtual void PointIntersectLineCaseTest1() {
32+
Point[] intersectSubject = new Point[] { new Point(50, 60), new Point(70, 60), new Point(50, 60) };
33+
Point[] intersecting = new Point[] { new Point(50, 50), new Point(50, 70), new Point(50, 50) };
34+
PdfCleanUpFilter filter = new PdfCleanUpFilter(new List<Rectangle>(), new CleanUpProperties());
35+
NUnit.Framework.Assert.IsTrue(filter.CheckIfRectanglesIntersect(intersectSubject, intersecting));
36+
}
37+
38+
[NUnit.Framework.Test]
39+
public virtual void PointIntersectLineCaseTest2() {
40+
Point[] intersectSubject = new Point[] { new Point(50, 60), new Point(70, 60), new Point(50, 60) };
41+
Point[] intersecting = new Point[] { new Point(50, 50), new Point(50, 30), new Point(50, 50) };
42+
PdfCleanUpFilter filter = new PdfCleanUpFilter(new List<Rectangle>(), new CleanUpProperties());
43+
NUnit.Framework.Assert.IsFalse(filter.CheckIfRectanglesIntersect(intersectSubject, intersecting));
44+
}
45+
46+
[NUnit.Framework.Test]
47+
public virtual void PointIntersectLineCaseTest3() {
48+
Point[] intersectSubject = new Point[] { new Point(50, 65), new Point(70, 65), new Point(50, 65) };
49+
Point[] intersecting = new Point[] { new Point(40, 50), new Point(60, 70), new Point(40, 50) };
50+
PdfCleanUpFilter filter = new PdfCleanUpFilter(new List<Rectangle>(), new CleanUpProperties());
51+
NUnit.Framework.Assert.IsFalse(filter.CheckIfRectanglesIntersect(intersectSubject, intersecting));
52+
}
53+
54+
[NUnit.Framework.Test]
55+
public virtual void PointIntersectLineCaseTest4() {
56+
Point[] intersectSubject = new Point[] { new Point(50, 60), new Point(70, 60), new Point(50, 60) };
57+
Point[] intersecting = new Point[] { new Point(30, 50), new Point(70, 70), new Point(30, 50) };
58+
PdfCleanUpFilter filter = new PdfCleanUpFilter(new List<Rectangle>(), new CleanUpProperties());
59+
NUnit.Framework.Assert.IsTrue(filter.CheckIfRectanglesIntersect(intersectSubject, intersecting));
60+
}
61+
62+
[NUnit.Framework.Test]
63+
public virtual void PointIntersectLineCaseTest5() {
64+
Point[] intersectSubject = new Point[] { new Point(50, 60), new Point(70, 60), new Point(50, 60) };
65+
Point[] intersecting = new Point[] { new Point(70, 50), new Point(30, 70), new Point(70, 50) };
66+
PdfCleanUpFilter filter = new PdfCleanUpFilter(new List<Rectangle>(), new CleanUpProperties());
67+
NUnit.Framework.Assert.IsTrue(filter.CheckIfRectanglesIntersect(intersectSubject, intersecting));
68+
}
69+
70+
[NUnit.Framework.Test]
71+
public virtual void PointIntersectLineCaseTest6() {
72+
Point[] intersectSubject = new Point[] { new Point(50, 80), new Point(70, 80), new Point(50, 80) };
73+
Point[] intersecting = new Point[] { new Point(50, 50), new Point(50, 70), new Point(50, 50) };
74+
PdfCleanUpFilter filter = new PdfCleanUpFilter(new List<Rectangle>(), new CleanUpProperties());
75+
NUnit.Framework.Assert.IsFalse(filter.CheckIfRectanglesIntersect(intersectSubject, intersecting));
76+
}
77+
78+
[NUnit.Framework.Test]
79+
public virtual void PointIntersectLineCaseTest7() {
80+
Point[] intersectSubject = new Point[] { new Point(50, 40), new Point(70, 40), new Point(50, 40) };
81+
Point[] intersecting = new Point[] { new Point(50, 50), new Point(50, 70), new Point(50, 50) };
82+
PdfCleanUpFilter filter = new PdfCleanUpFilter(new List<Rectangle>(), new CleanUpProperties());
83+
NUnit.Framework.Assert.IsFalse(filter.CheckIfRectanglesIntersect(intersectSubject, intersecting));
84+
}
85+
86+
[NUnit.Framework.Test]
87+
public virtual void PointIntersectLineCaseTest8() {
88+
Point[] intersectSubject = new Point[] { new Point(50, 20), new Point(70, 20), new Point(50, 20) };
89+
Point[] intersecting = new Point[] { new Point(50, 50), new Point(50, 30), new Point(50, 50) };
90+
PdfCleanUpFilter filter = new PdfCleanUpFilter(new List<Rectangle>(), new CleanUpProperties());
91+
NUnit.Framework.Assert.IsFalse(filter.CheckIfRectanglesIntersect(intersectSubject, intersecting));
92+
}
93+
94+
[NUnit.Framework.Test]
95+
public virtual void PointIntersectLineCaseTest9() {
96+
Point[] intersectSubject = new Point[] { new Point(50, 40), new Point(70, 40), new Point(50, 40) };
97+
Point[] intersecting = new Point[] { new Point(50, 50), new Point(50, 30), new Point(50, 50) };
98+
PdfCleanUpFilter filter = new PdfCleanUpFilter(new List<Rectangle>(), new CleanUpProperties());
99+
NUnit.Framework.Assert.IsTrue(filter.CheckIfRectanglesIntersect(intersectSubject, intersecting));
100+
}
101+
102+
[NUnit.Framework.Test]
103+
public virtual void PointIntersectLineCaseTest10() {
104+
Point[] intersectSubject = new Point[] { new Point(30, 80), new Point(90, 80), new Point(30, 80) };
105+
Point[] intersecting = new Point[] { new Point(60, 50), new Point(40, 70), new Point(60, 50) };
106+
PdfCleanUpFilter filter = new PdfCleanUpFilter(new List<Rectangle>(), new CleanUpProperties());
107+
NUnit.Framework.Assert.IsFalse(filter.CheckIfRectanglesIntersect(intersectSubject, intersecting));
108+
}
109+
30110
[NUnit.Framework.Test]
31111
public virtual void CheckIfRectanglesIntersect_completelyCoveredBasic() {
32112
Point[] intersectSubject = new Point[] { new Point(70, 70), new Point(80, 70), new Point(80, 80), new Point

itext.tests/itext.cleanup.tests/itext/pdfcleanup/PdfCleanUpProcessorUnitTest.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,28 +144,28 @@ public virtual void OpenNotWrittenTagsEmptyTest() {
144144
}
145145

146146
private void TestOpenNotWrittenTags(LinkedList<CanvasTag> tags) {
147-
PdfCleanUpProcessor processor = new _PdfCleanUpProcessor_161(tags, null, null);
147+
PdfCleanUpProcessor processor = new _PdfCleanUpProcessor_160(tags, null, null);
148148
foreach (CanvasTag tag in tags) {
149149
processor.AddNotWrittenTag(tag);
150150
}
151151
processor.OpenNotWrittenTags();
152152
}
153153

154-
private sealed class _PdfCleanUpProcessor_161 : PdfCleanUpProcessor {
155-
public _PdfCleanUpProcessor_161(LinkedList<CanvasTag> tags, IList<Rectangle> baseArg1, PdfDocument baseArg2
154+
private sealed class _PdfCleanUpProcessor_160 : PdfCleanUpProcessor {
155+
public _PdfCleanUpProcessor_160(LinkedList<CanvasTag> tags, IList<Rectangle> baseArg1, PdfDocument baseArg2
156156
)
157157
: base(baseArg1, baseArg2) {
158158
this.tags = tags;
159159
}
160160

161161
//\cond DO_NOT_DOCUMENT
162162
internal override PdfCanvas GetCanvas() {
163-
return new _PdfCanvas_164(tags, new PdfStream(), null, null);
163+
return new _PdfCanvas_163(tags, new PdfStream(), null, null);
164164
}
165165
//\endcond
166166

167-
private sealed class _PdfCanvas_164 : PdfCanvas {
168-
public _PdfCanvas_164(LinkedList<CanvasTag> tags, PdfStream baseArg1, PdfResources baseArg2, PdfDocument baseArg3
167+
private sealed class _PdfCanvas_163 : PdfCanvas {
168+
public _PdfCanvas_163(LinkedList<CanvasTag> tags, PdfStream baseArg1, PdfResources baseArg2, PdfDocument baseArg3
169169
)
170170
: base(baseArg1, baseArg2, baseArg3) {
171171
this.tags = tags;

itext.tests/itext.cleanup.tests/itext/pdfcleanup/PdfCleanUpToolTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,8 +638,7 @@ public virtual void AutoCleanWithFalseProcessAnnotationTest() {
638638
IList<iText.PdfCleanup.PdfCleanUpLocation> additionalLocation = new List<iText.PdfCleanup.PdfCleanUpLocation
639639
>();
640640
additionalLocation.Add(new iText.PdfCleanup.PdfCleanUpLocation(1, new Rectangle(100, 560, 200, 30)));
641-
CleanUpProperties properties = new CleanUpProperties();
642-
properties.SetProcessAnnotations(false);
641+
CleanUpProperties properties = new CleanUpProperties().SetProcessAnnotations(false);
643642
PdfCleaner.AutoSweepCleanUp(new FileStream(input, FileMode.Open, FileAccess.Read), new FileStream(output,
644643
FileMode.Create), strategy, additionalLocation, properties);
645644
CompareByContent(cmp, output, OUTPUT_PATH, "autoCleanWithFalseProcessAnnotationTest");

itext/itext.cleanup/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121

2222
[assembly: Guid("ec333396-8945-4d69-b626-475b4e2ede61")]
2323

24-
[assembly: AssemblyVersion("4.0.3.0")]
25-
[assembly: AssemblyFileVersion("4.0.3.0")]
26-
[assembly: AssemblyInformationalVersion("4.0.3")]
24+
[assembly: AssemblyVersion("5.0.0.0")]
25+
[assembly: AssemblyFileVersion("5.0.0.0")]
26+
[assembly: AssemblyInformationalVersion("5.0.0")]

itext/itext.cleanup/itext.cleanup.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
</ItemGroup>
3131
<ItemGroup>
3232
<ProjectReference Include="..\..\..\itextcore\itext\itext.io\itext.io.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.io\itext.io.csproj')" />
33-
<PackageReference Include="itext" Version="8.0.5" Condition="!Exists('..\..\..\itextcore\itext\itext.io\itext.io.csproj')" />
33+
<PackageReference Include="itext" Version="9.0.0" Condition="!Exists('..\..\..\itextcore\itext\itext.io\itext.io.csproj')" />
3434
<ProjectReference Include="..\..\..\itextcore\itext\itext.kernel\itext.kernel.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.kernel\itext.kernel.csproj')" />
3535
<ProjectReference Include="..\..\..\itextcore\itext\itext.layout\itext.layout.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.layout\itext.layout.csproj')" />
3636
</ItemGroup>

0 commit comments

Comments
 (0)