Skip to content

Commit

Permalink
[RELEASE] iText 7 pdfSweep 3.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
iText-CI committed Jan 4, 2023
2 parents 4435ebd + 2d65055 commit 7a50598
Show file tree
Hide file tree
Showing 54 changed files with 184 additions and 69 deletions.
2 changes: 1 addition & 1 deletion doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.

PROJECT_NAME = "pdfSweep 3.0.1 API"
PROJECT_NAME = "pdfSweep 3.0.2 API"

# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
Expand Down
8 changes: 4 additions & 4 deletions itext.tests/itext.cleanup.tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("iText Group NV")]
[assembly: AssemblyProduct("iText")]
[assembly: AssemblyCopyright("Copyright (c) 1998-2022 iText Group NV")]
[assembly: AssemblyCopyright("Copyright (c) 1998-2023 iText Group NV")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: ComVisible(false)]

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

[assembly: AssemblyVersion("3.0.1.0")]
[assembly: AssemblyFileVersion("3.0.1.0")]
[assembly: AssemblyInformationalVersion("3.0.1")]
[assembly: AssemblyVersion("3.0.2.0")]
[assembly: AssemblyFileVersion("3.0.2.0")]
[assembly: AssemblyInformationalVersion("3.0.2")]

[assembly: NUnit.Framework.Timeout(300000)]
10 changes: 5 additions & 5 deletions itext.tests/itext.cleanup.tests/itext.cleanup.tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\itextcore\itext\itext.io\itext.io.netstandard.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.io\itext.io.netstandard.csproj')" />
<PackageReference Include="itext7" Version="7.2.3" Condition="!Exists('..\..\..\itextcore\itext\itext.io\itext.io.netstandard.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.kernel\itext.kernel.netstandard.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.kernel\itext.kernel.netstandard.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.netstandard.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.netstandard.csproj')" />
<PackageReference Include="itext7.pdftest" Version="7.2.3" Condition="!Exists('..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.netstandard.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.io\itext.io.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.io\itext.io.csproj')" />
<PackageReference Include="itext7" Version="7.2.5" Condition="!Exists('..\..\..\itextcore\itext\itext.io\itext.io.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.kernel\itext.kernel.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.kernel\itext.kernel.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.csproj')" />
<PackageReference Include="itext7.pdftest" Version="7.2.5" Condition="!Exists('..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.csproj')" />
<ProjectReference Include="..\..\itext\itext.cleanup\itext.cleanup.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2022 iText Group NV
Copyright (c) 1998-2023 iText Group NV
Authors: iText Software.
This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -53,6 +53,7 @@ source product.
using iText.Test;

namespace iText.PdfCleanup {
[NUnit.Framework.Category("IntegrationTest")]
public class BigDocumentAutoCleanUpTest : ExtendedITextTest {
private static readonly String inputPath = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
.CurrentContext.TestDirectory) + "/resources/itext/pdfcleanup/BigDocumentAutoCleanUpTest/";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2022 iText Group NV
Copyright (c) 1998-2023 iText Group NV
Authors: iText Software.
This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -50,6 +50,7 @@ source product.
using iText.Test.Attributes;

namespace iText.PdfCleanup {
[NUnit.Framework.Category("IntegrationTest")]
public class BigDocumentCleanUpTest : ExtendedITextTest {
private static readonly String inputPath = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
.CurrentContext.TestDirectory) + "/resources/itext/pdfcleanup/BigDocumentCleanUpTest/";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2022 iText Group NV
Copyright (c) 1998-2023 iText Group NV
Authors: iText Software.
This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -52,6 +52,7 @@ source product.
using iText.Test.Attributes;

namespace iText.PdfCleanup {
[NUnit.Framework.Category("IntegrationTest")]
public class CleanUpAnnotationTest : ExtendedITextTest {
private static readonly String inputPath = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
.CurrentContext.TestDirectory) + "/resources/itext/pdfcleanup/CleanUpAnnotationTest/";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2022 iText Group NV
Copyright (c) 1998-2023 iText Group NV
Authors: iText Software.
This program is offered under a commercial and under the AGPL license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2022 iText Group NV
Copyright (c) 1998-2023 iText Group NV
Authors: iText Software.
This program is offered under a commercial and under the AGPL license.
Expand Down Expand Up @@ -29,6 +29,7 @@ You should have received a copy of the GNU Affero General Public License
using iText.Test;

namespace iText.PdfCleanup {
[NUnit.Framework.Category("IntegrationTest")]
public class CleanUpImageUtilTest : ExtendedITextTest {
private static readonly String SOURCE_PATH = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
.CurrentContext.TestDirectory) + "/resources/itext/pdfcleanup/CleanupImageHandlingUtilTest/";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2022 iText Group NV
Copyright (c) 1998-2023 iText Group NV
Authors: iText Software.
This program is offered under a commercial and under the AGPL license.
Expand All @@ -27,6 +27,7 @@ You should have received a copy of the GNU Affero General Public License
using iText.Test;

namespace iText.PdfCleanup {
[NUnit.Framework.Category("IntegrationTest")]
public class CleanUpInvalidPdfTest : ExtendedITextTest {
private static readonly String inputPath = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
.CurrentContext.TestDirectory) + "/resources/itext/pdfcleanup/CleanUpInvalidPdfTest/";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2022 iText Group NV
Copyright (c) 1998-2023 iText Group NV
Authors: iText Software.
This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -47,6 +47,7 @@ source product.
using iText.Test;

namespace iText.PdfCleanup {
[NUnit.Framework.Category("IntegrationTest")]
public class CleanUpTaggedPdfTest : ExtendedITextTest {
private static readonly String inputPath = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
.CurrentContext.TestDirectory) + "/resources/itext/pdfcleanup/CleanUpTaggedPdfTest/";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2022 iText Group NV
Copyright (c) 1998-2023 iText Group NV
Authors: iText Software.
This program is offered under a commercial and under the AGPL license.
Expand Down Expand Up @@ -39,6 +39,7 @@ You should have received a copy of the GNU Affero General Public License
using iText.Test;

namespace iText.PdfCleanup {
[NUnit.Framework.Category("IntegrationTest")]
public class CleanupLicenseEventsTest : ExtendedITextTest {
private static readonly String INPUT_PATH = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
.CurrentContext.TestDirectory) + "/resources/itext/pdfcleanup/PdfCleanUpToolTest/";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2022 iText Group NV
Copyright (c) 1998-2023 iText Group NV
Authors: iText Software.
This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -49,6 +49,7 @@ source product.
using iText.Test;

namespace iText.PdfCleanup {
[NUnit.Framework.Category("IntegrationTest")]
public class FilteredImagesCacheTest : ExtendedITextTest {
private static readonly String inputPath = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
.CurrentContext.TestDirectory) + "/resources/itext/pdfcleanup/FilteredImagesCacheTest/";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2022 iText Group NV
Copyright (c) 1998-2023 iText Group NV
Authors: iText Software.
This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -50,6 +50,7 @@ source product.
using iText.Test;

namespace iText.PdfCleanup {
[NUnit.Framework.Category("IntegrationTest")]
public class PdfAutoSweepToolsTest : ExtendedITextTest {
private static readonly String INPUT_PATH = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
.CurrentContext.TestDirectory) + "/resources/itext/pdfcleanup/PdfAutoSweepTest/";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2022 iText Group NV
Copyright (c) 1998-2023 iText Group NV
Authors: iText Software.
This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -44,6 +44,7 @@ source product.
using iText.Test;

namespace iText.PdfCleanup {
[NUnit.Framework.Category("UnitTest")]
public class PdfCleanUpFilterUnitTest : ExtendedITextTest {
[NUnit.Framework.Test]
public virtual void CheckIfRectanglesIntersect_completelyCoveredBasic() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2022 iText Group NV
Copyright (c) 1998-2023 iText Group NV
Authors: iText Software.
This program is offered under a commercial and under the AGPL license.
Expand Down Expand Up @@ -30,6 +30,7 @@ You should have received a copy of the GNU Affero General Public License
using iText.Test;

namespace iText.PdfCleanup {
[NUnit.Framework.Category("UnitTest")]
public class PdfCleanUpProcessorUnitTest : ExtendedITextTest {
[NUnit.Framework.Test]
public virtual void AreColorSpacesDifferentForJavaNullValuesTest() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2022 iText Group NV
Copyright (c) 1998-2023 iText Group NV
Authors: iText Software.
This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -58,6 +58,7 @@ source product.
using iText.Test.Attributes;

namespace iText.PdfCleanup {
[NUnit.Framework.Category("IntegrationTest")]
public class PdfCleanUpToolTest : ExtendedITextTest {
private static readonly String INPUT_PATH = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
.CurrentContext.TestDirectory) + "/resources/itext/pdfcleanup/PdfCleanUpToolTest/";
Expand Down Expand Up @@ -948,6 +949,22 @@ public virtual void LineArtsDrawingOnCanvasTest() {
CompareByContent(cmp, output, OUTPUT_PATH, "diff_lineArtsDrawingOnCanvasTest_");
}

[NUnit.Framework.Test]
public virtual void CheckUnSupportedImageTypeTest() {
String input = INPUT_PATH + "UnsupportedImageType.pdf";
String output = OUTPUT_PATH + "UnsupportedImageType.pdf";
PdfDocument pdfDocument = new PdfDocument(new PdfReader(input), new PdfWriter(output, new WriterProperties
()));
iText.PdfCleanup.PdfCleanUpTool workingTool = new iText.PdfCleanup.PdfCleanUpTool(pdfDocument);
int pageIndex = 1;
Rectangle area = pdfDocument.GetPage(pageIndex).GetPageSize();
workingTool.AddCleanupLocation(new iText.PdfCleanup.PdfCleanUpLocation(pageIndex, area));
Exception e = NUnit.Framework.Assert.Catch(typeof(Exception), () => workingTool.CleanUp());
NUnit.Framework.Assert.AreEqual(CleanupExceptionMessageConstant.UNSUPPORTED_IMAGE_TYPE.ToLowerInvariant(),
e.Message.ToLowerInvariant());
pdfDocument.Close();
}

private void CleanUp(String input, String output, IList<iText.PdfCleanup.PdfCleanUpLocation> cleanUpLocations
) {
PdfDocument pdfDocument = new PdfDocument(new PdfReader(input), new PdfWriter(output));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2022 iText Group NV
Copyright (c) 1998-2023 iText Group NV
Authors: iText Software.
This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -52,6 +52,7 @@ source product.
using iText.Test.Attributes;

namespace iText.PdfCleanup {
[NUnit.Framework.Category("IntegrationTest")]
public class PdfCleanUpToolWithInlineImagesTest : ExtendedITextTest {
private static readonly String inputPath = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
.CurrentContext.TestDirectory) + "/resources/itext/pdfcleanup/PdfCleanUpToolWithInlineImagesTest/";
Expand Down
71 changes: 71 additions & 0 deletions itext.tests/itext.cleanup.tests/itext/pdfcleanup/RectangleTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2023 iText Group NV
Authors: iText Software.
This program is offered under a commercial and under the AGPL license.
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
AGPL licensing:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
using System;
using System.IO;
using iText.Kernel.Colors;
using iText.Kernel.Geom;
using iText.Kernel.Pdf;
using iText.Kernel.Pdf.Canvas;
using iText.Kernel.Utils;
using iText.Test;

namespace iText.PdfCleanup {
[NUnit.Framework.Category("IntegrationTest")]
public class RectangleTest : ExtendedITextTest {
private static readonly String SOURCE_FOLDER = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
.CurrentContext.TestDirectory) + "/resources/itext/pdfcleanup/RectangleTest/";

private static readonly String DESTINATION_FOLDER = NUnit.Framework.TestContext.CurrentContext.TestDirectory
+ "/test/itext/pdfcleanup/RectangleTest/";

[NUnit.Framework.OneTimeSetUp]
public static void BeforeClass() {
CreateDestinationFolder(DESTINATION_FOLDER);
}

[NUnit.Framework.Test]
public virtual void ZeroWidthLineTest() {
// TODO DEVSIX-7136 Rectangles drawn with zero-width line disappear on sweeping
String outPdf = DESTINATION_FOLDER + "zeroWidthLine.pdf";
String cmpPdf = SOURCE_FOLDER + "cmp_zeroWidthLine.pdf";
MemoryStream outDocBaos = new MemoryStream();
using (PdfDocument pdfDocument = new PdfDocument(new PdfWriter(outDocBaos))) {
PdfPage page = pdfDocument.AddNewPage();
PdfCanvas canvas = new PdfCanvas(page);
canvas.SetStrokeColor(DeviceRgb.BLUE).SetLineWidth(0).Rectangle(new Rectangle(350, 400, 100, 100)).Stroke(
);
canvas.SetStrokeColor(DeviceRgb.RED).SetLineWidth(0).MoveTo(100, 100).LineTo(100, 200).LineTo(200, 200).LineTo
(200, 100).ClosePath().Stroke();
}
PdfDocument pdfDocument_1 = new PdfDocument(new PdfReader(new MemoryStream(outDocBaos.ToArray())), new PdfWriter
(outPdf));
iText.PdfCleanup.PdfCleanUpTool workingTool = new iText.PdfCleanup.PdfCleanUpTool(pdfDocument_1);
Rectangle area = new Rectangle(0, 50, 150, 150);
workingTool.AddCleanupLocation(new iText.PdfCleanup.PdfCleanUpLocation(1, area, ColorConstants.RED));
workingTool.CleanUp();
pdfDocument_1.Close();
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(outPdf, cmpPdf, DESTINATION_FOLDER, "diff_"
));
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2022 iText Group NV
Copyright (c) 1998-2023 iText Group NV
Authors: iText Software.
This program is offered under a commercial and under the AGPL license.
Expand Down Expand Up @@ -30,6 +30,7 @@ You should have received a copy of the GNU Affero General Public License
using iText.Test;

namespace iText.PdfCleanup {
[NUnit.Framework.Category("UnitTest")]
public class TextPositioningTest : ExtendedITextTest {
public const float EPS = 0.0001F;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2022 iText Group NV
Copyright (c) 1998-2023 iText Group NV
Authors: iText Software.
This program is offered under a commercial and under the AGPL license.
Expand Down Expand Up @@ -29,6 +29,7 @@ You should have received a copy of the GNU Affero General Public License
using iText.Test;

namespace iText.PdfCleanup.Images {
[NUnit.Framework.Category("IntegrationTest")]
public class CleanUpImageIndexedColorSpaceTest : ExtendedITextTest {
private static readonly String inputPath = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
.CurrentContext.TestDirectory) + "/resources/itext/pdfcleanup/images/CleanUpImageIndexedColorSpaceTest/";
Expand Down
Loading

0 comments on commit 7a50598

Please sign in to comment.