Skip to content

Commit 3167bc6

Browse files
committed
[RELEASE] iText pdfOCR 4.0.0
2 parents 7657d96 + 0fc204d commit 3167bc6

File tree

57 files changed

+424
-184
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+424
-184
lines changed

SECURITY.md

+40
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 pdfOCR 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 pdfOCR, we recommend the following best practices:
35+
36+
1. **Keep pdfOCR 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

+2-2
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 = "pdfOCR 3.0.2 API"
35+
PROJECT_NAME = "pdfOCR 4.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
@@ -485,7 +485,7 @@ EXTRACT_PRIV_VIRTUAL = NO
485485
# scope will be included in the documentation.
486486
# The default value is: NO.
487487

488-
EXTRACT_PACKAGE = NO
488+
EXTRACT_PACKAGE = YES
489489

490490
# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
491491
# included in the documentation.

itext.tests/itext.pdfocr.api.tests/Properties/AssemblyInfo.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515

1616
[assembly: Guid("d6a6ea97-1f23-448f-b700-eff62971d234")]
1717

18-
[assembly: AssemblyVersion("3.0.2.0")]
19-
[assembly: AssemblyFileVersion("3.0.2.0")]
20-
[assembly: AssemblyInformationalVersion("3.0.2")]
18+
[assembly: AssemblyVersion("4.0.0.0")]
19+
[assembly: AssemblyFileVersion("4.0.0.0")]
20+
[assembly: AssemblyInformationalVersion("4.0.0")]

itext.tests/itext.pdfocr.api.tests/itext.pdfocr.api.tests.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
</ItemGroup>
2626
<ItemGroup>
2727
<ProjectReference Include="..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.csproj')" />
28-
<PackageReference Include="itext.pdftest" Version="8.0.3" Condition="!Exists('..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.csproj')" />
28+
<PackageReference Include="itext.pdftest" Version="9.0.0" Condition="!Exists('..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.csproj')" />
2929
<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')" />
30-
<PackageReference Include="itext.bouncy-castle-adapter" Version="8.0.3" Condition="!Exists('..\..\..\itextcore\itext\itext.bouncy-castle-adapter\itext.bouncy-castle-adapter.csproj')" />
30+
<PackageReference Include="itext.bouncy-castle-adapter" Version="9.0.0" Condition="!Exists('..\..\..\itextcore\itext\itext.bouncy-castle-adapter\itext.bouncy-castle-adapter.csproj')" />
3131
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.0" />
3232
<PackageReference Include="NUnit" Version="3.12.0" />
3333
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1">

itext.tests/itext.pdfocr.api.tests/itext/pdfocr/ApiTest.cs

+15-15
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ public virtual void CreatePdfAFileWithFileTest() {
103103
String contentBytes = iText.Commons.Utils.JavaUtil.GetStringForBytes(pdf.GetPage(1).GetContentBytes(), System.Text.Encoding
104104
.UTF8);
105105
NUnit.Framework.Assert.IsTrue(contentBytes.Contains("<00190014001c001400150014>"));
106-
PdfAConformanceLevel cl = pdf.GetReader().GetPdfAConformanceLevel();
107-
NUnit.Framework.Assert.AreEqual(PdfAConformanceLevel.PDF_A_3U.GetConformance(), cl.GetConformance());
108-
NUnit.Framework.Assert.AreEqual(PdfAConformanceLevel.PDF_A_3U.GetPart(), cl.GetPart());
106+
PdfAConformance cl = pdf.GetReader().GetPdfConformance().GetAConformance();
107+
NUnit.Framework.Assert.AreEqual(PdfAConformance.PDF_A_3U.GetLevel(), cl.GetLevel());
108+
NUnit.Framework.Assert.AreEqual(PdfAConformance.PDF_A_3U.GetPart(), cl.GetPart());
109109
}
110110
}
111111

@@ -120,9 +120,9 @@ public virtual void CreatePdfAFileWithFileNoMetaTest() {
120120
String contentBytes = iText.Commons.Utils.JavaUtil.GetStringForBytes(pdf.GetPage(1).GetContentBytes(), System.Text.Encoding
121121
.UTF8);
122122
NUnit.Framework.Assert.IsTrue(contentBytes.Contains("<00190014001c001400150014>"));
123-
PdfAConformanceLevel cl = pdf.GetReader().GetPdfAConformanceLevel();
124-
NUnit.Framework.Assert.AreEqual(PdfAConformanceLevel.PDF_A_3U.GetConformance(), cl.GetConformance());
125-
NUnit.Framework.Assert.AreEqual(PdfAConformanceLevel.PDF_A_3U.GetPart(), cl.GetPart());
123+
PdfAConformance cl = pdf.GetReader().GetPdfConformance().GetAConformance();
124+
NUnit.Framework.Assert.AreEqual(PdfAConformance.PDF_A_3U.GetLevel(), cl.GetLevel());
125+
NUnit.Framework.Assert.AreEqual(PdfAConformance.PDF_A_3U.GetPart(), cl.GetPart());
126126
}
127127
}
128128

@@ -167,7 +167,7 @@ public virtual void TestThaiImageWithNotDefGlyphs() {
167167

168168
[NUnit.Framework.Test]
169169
public virtual void TestImageRotationHandler() {
170-
NUnit.Framework.Assert.That(() => {
170+
Exception exception = NUnit.Framework.Assert.Catch(typeof(Exception), () => {
171171
OcrPdfCreatorProperties properties = new OcrPdfCreatorProperties();
172172
properties.SetImageRotationHandler(new ApiTest.NotImplementedImageRotationHandler());
173173
String testName = "testSetAndGetImageRotationHandler";
@@ -176,13 +176,13 @@ public virtual void TestImageRotationHandler() {
176176
PdfHelper.CreatePdf(pdfPath, new FileInfo(path), properties);
177177
NUnit.Framework.Assert.IsNotNull(properties.GetImageRotationHandler());
178178
}
179-
, NUnit.Framework.Throws.InstanceOf<Exception>().With.Message.EqualTo("applyRotation is not implemented"))
180-
;
179+
);
180+
NUnit.Framework.Assert.AreEqual("applyRotation is not implemented", exception.Message);
181181
}
182182

183183
[NUnit.Framework.Test]
184184
public virtual void TestImageRotationHandlerForTiff() {
185-
NUnit.Framework.Assert.That(() => {
185+
Exception exception = NUnit.Framework.Assert.Catch(typeof(Exception), () => {
186186
OcrPdfCreatorProperties properties = new OcrPdfCreatorProperties();
187187
properties.SetImageRotationHandler(new ApiTest.NotImplementedImageRotationHandler());
188188
String testName = "testSetAndGetImageRotationHandler";
@@ -191,8 +191,8 @@ public virtual void TestImageRotationHandlerForTiff() {
191191
PdfHelper.CreatePdf(pdfPath, new FileInfo(path), properties);
192192
NUnit.Framework.Assert.IsNotNull(properties.GetImageRotationHandler());
193193
}
194-
, NUnit.Framework.Throws.InstanceOf<Exception>().With.Message.EqualTo("applyRotation is not implemented"))
195-
;
194+
);
195+
NUnit.Framework.Assert.AreEqual("applyRotation is not implemented", exception.Message);
196196
}
197197

198198
[NUnit.Framework.Test]
@@ -215,21 +215,21 @@ public virtual void TestTableStructureTree() {
215215
}
216216

217217
[NUnit.Framework.Test]
218-
[LogMessage(PdfOcrExceptionMessageConstant.CANNOT_CREATE_PDF_DOCUMENT, LogLevel = LogLevelConstants.ERROR)]
219218
public virtual void TestTaggingNotSupported() {
220219
String input = PdfHelper.GetImagesTestDirectory() + "numbers_01.jpg";
221220
String pdfPath = PdfHelper.GetTargetDirectory() + "taggingNotSupported.pdf";
222221
Exception e = NUnit.Framework.Assert.Catch(typeof(PdfOcrException), () => PdfHelper.CreatePdf(pdfPath, new
223222
FileInfo(input), new OcrPdfCreatorProperties().SetTagged(true)));
224-
NUnit.Framework.Assert.AreEqual(MessageFormatUtil.Format(PdfOcrExceptionMessageConstant.CANNOT_CREATE_PDF_DOCUMENT
225-
, PdfOcrExceptionMessageConstant.TAGGING_IS_NOT_SUPPORTED), e.Message);
223+
NUnit.Framework.Assert.AreEqual(PdfOcrExceptionMessageConstant.TAGGING_IS_NOT_SUPPORTED, e.Message);
226224
}
227225

226+
//\cond DO_NOT_DOCUMENT
228227
internal class NotImplementedImageRotationHandler : IImageRotationHandler {
229228
public virtual ImageData ApplyRotation(ImageData imageData) {
230229
throw new Exception("applyRotation is not implemented");
231230
}
232231
}
232+
//\endcond
233233

234234
private class DummyMetaInfo : IMetaInfo {
235235
}

itext.tests/itext.pdfocr.api.tests/itext/pdfocr/PdfA3uTest.cs

+15-11
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public virtual void TestPdfA3uWithNullIntent() {
5454

5555
[NUnit.Framework.Test]
5656
public virtual void TestIncompatibleOutputIntentAndFontColorSpaceException() {
57-
NUnit.Framework.Assert.That(() => {
57+
Exception exception = NUnit.Framework.Assert.Catch(typeof(PdfException), () => {
5858
String testName = "testIncompatibleOutputIntentAndFontColorSpaceException";
5959
String path = PdfHelper.GetDefaultImagePath();
6060
String pdfPath = PdfHelper.GetTargetDirectory() + testName + ".pdf";
@@ -64,8 +64,9 @@ public virtual void TestIncompatibleOutputIntentAndFontColorSpaceException() {
6464
PdfHelper.CreatePdfA(pdfPath, new FileInfo(path), ocrPdfCreatorProperties, PdfHelper.GetRGBPdfOutputIntent
6565
());
6666
}
67-
, NUnit.Framework.Throws.InstanceOf<PdfException>().With.Message.EqualTo(PdfAConformanceException.DEVICECMYK_MAY_BE_USED_ONLY_IF_THE_FILE_HAS_A_CMYK_PDFA_OUTPUT_INTENT_OR_DEFAULTCMYK_IN_USAGE_CONTEXT))
68-
;
67+
);
68+
NUnit.Framework.Assert.AreEqual(PdfaExceptionMessageConstant.DEVICECMYK_MAY_BE_USED_ONLY_IF_THE_FILE_HAS_A_CMYK_PDFA_OUTPUT_INTENT_OR_DEFAULTCMYK_IN_USAGE_CONTEXT
69+
, exception.Message);
6970
}
7071

7172
[NUnit.Framework.Test]
@@ -81,7 +82,7 @@ public virtual void TestPdfA3DefaultMetadata() {
8182
PdfDocument pdfDocument = new PdfDocument(new PdfReader(pdfPath));
8283
NUnit.Framework.Assert.AreEqual("en-US", pdfDocument.GetCatalog().GetLang().ToString());
8384
NUnit.Framework.Assert.AreEqual(null, pdfDocument.GetDocumentInfo().GetTitle());
84-
NUnit.Framework.Assert.AreEqual(PdfAConformanceLevel.PDF_A_3U, pdfDocument.GetReader().GetPdfAConformanceLevel
85+
NUnit.Framework.Assert.AreEqual(PdfAConformance.PDF_A_3U, pdfDocument.GetReader().GetPdfConformance().GetAConformance
8586
());
8687
pdfDocument.Close();
8788
}
@@ -102,15 +103,15 @@ public virtual void TestPdfCustomMetadata() {
102103
PdfDocument pdfDocument = new PdfDocument(new PdfReader(pdfPath));
103104
NUnit.Framework.Assert.AreEqual(locale, pdfDocument.GetCatalog().GetLang().ToString());
104105
NUnit.Framework.Assert.AreEqual(title, pdfDocument.GetDocumentInfo().GetTitle());
105-
NUnit.Framework.Assert.AreEqual(PdfAConformanceLevel.PDF_A_3U, pdfDocument.GetReader().GetPdfAConformanceLevel
106+
NUnit.Framework.Assert.AreEqual(PdfAConformance.PDF_A_3U, pdfDocument.GetReader().GetPdfConformance().GetAConformance
106107
());
107108
pdfDocument.Close();
108109
}
109110

110111
[LogMessage(PdfOcrExceptionMessageConstant.CANNOT_CREATE_PDF_DOCUMENT, Count = 1)]
111112
[NUnit.Framework.Test]
112113
public virtual void TestNonCompliantThaiPdfA() {
113-
NUnit.Framework.Assert.That(() => {
114+
Exception exception = NUnit.Framework.Assert.Catch(typeof(PdfOcrException), () => {
114115
String testName = "testNonCompliantThaiPdfA";
115116
String path = PdfHelper.GetThaiImagePath();
116117
String pdfPath = PdfHelper.GetTargetDirectory() + testName + ".pdf";
@@ -120,8 +121,10 @@ public virtual void TestNonCompliantThaiPdfA() {
120121
PdfHelper.CreatePdfA(pdfPath, new FileInfo(path), ocrPdfCreatorProperties, PdfHelper.GetRGBPdfOutputIntent
121122
());
122123
}
123-
, NUnit.Framework.Throws.InstanceOf<PdfOcrException>().With.Message.EqualTo(MessageFormatUtil.Format(PdfOcrExceptionMessageConstant.CANNOT_CREATE_PDF_DOCUMENT, MessageFormatUtil.Format(PdfOcrLogMessageConstant.COULD_NOT_FIND_CORRESPONDING_GLYPH_TO_UNICODE_CHARACTER, 3611))))
124-
;
124+
);
125+
NUnit.Framework.Assert.AreEqual(MessageFormatUtil.Format(PdfOcrExceptionMessageConstant.CANNOT_CREATE_PDF_DOCUMENT
126+
, MessageFormatUtil.Format(PdfOcrLogMessageConstant.COULD_NOT_FIND_CORRESPONDING_GLYPH_TO_UNICODE_CHARACTER
127+
, 3611)), exception.Message);
125128
}
126129

127130
[NUnit.Framework.Test]
@@ -153,15 +156,16 @@ public virtual void TestCompliantThaiPdfA() {
153156
[LogMessage(PdfOcrExceptionMessageConstant.CANNOT_CREATE_PDF_DOCUMENT, Count = 1)]
154157
[NUnit.Framework.Test]
155158
public virtual void TestPdfACreateWithoutPdfLangProperty() {
156-
NUnit.Framework.Assert.That(() => {
159+
Exception exception = NUnit.Framework.Assert.Catch(typeof(PdfOcrException), () => {
157160
String testName = "testPdfACreateWithoutPdfLangProperty";
158161
String path = PdfHelper.GetThaiImagePath();
159162
String pdfPath = PdfHelper.GetTargetDirectory() + testName + ".pdf";
160163
PdfHelper.CreatePdfA(pdfPath, new FileInfo(path), new OcrPdfCreatorProperties(), PdfHelper.GetRGBPdfOutputIntent
161164
());
162165
}
163-
, NUnit.Framework.Throws.InstanceOf<PdfOcrException>().With.Message.EqualTo(MessageFormatUtil.Format(PdfOcrExceptionMessageConstant.CANNOT_CREATE_PDF_DOCUMENT, PdfOcrLogMessageConstant.PDF_LANGUAGE_PROPERTY_IS_NOT_SET)))
164-
;
166+
);
167+
NUnit.Framework.Assert.AreEqual(MessageFormatUtil.Format(PdfOcrExceptionMessageConstant.CANNOT_CREATE_PDF_DOCUMENT
168+
, PdfOcrLogMessageConstant.PDF_LANGUAGE_PROPERTY_IS_NOT_SET), exception.Message);
165169
}
166170
}
167171
}

itext.tests/itext.pdfocr.api.tests/itext/pdfocr/PdfCreatorUtilTest.cs

+7-10
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2020
You should have received a copy of the GNU Affero General Public License
2121
along with this program. If not, see <https://www.gnu.org/licenses/>.
2222
*/
23+
using System;
2324
using System.Collections.Generic;
2425
using System.IO;
2526
using iText.Commons.Utils;
@@ -70,21 +71,17 @@ public virtual void GetImageDataFromValidNotTiffTest() {
7071
[NUnit.Framework.Test]
7172
[LogMessage(PdfOcrLogMessageConstant.CANNOT_READ_INPUT_IMAGE)]
7273
public virtual void GetImageDataFromNotExistingImageTest() {
73-
NUnit.Framework.Assert.That(() => {
74-
PdfCreatorUtil.GetImageData(new FileInfo("no such path"), null);
75-
}
76-
, NUnit.Framework.Throws.InstanceOf<PdfOcrInputException>())
77-
;
74+
NUnit.Framework.Assert.Catch(typeof(PdfOcrInputException), () => PdfCreatorUtil.GetImageData(new FileInfo(
75+
"no such path"), null));
7876
}
7977

8078
[NUnit.Framework.Test]
8179
[LogMessage(PdfOcrLogMessageConstant.CANNOT_READ_INPUT_IMAGE)]
8280
public virtual void GetImageDataFromInvalidImageTest() {
83-
NUnit.Framework.Assert.That(() => {
84-
PdfCreatorUtil.GetImageData(new FileInfo(PdfHelper.GetImagesTestDirectory() + "corrupted.jpg"), null);
85-
}
86-
, NUnit.Framework.Throws.InstanceOf<PdfOcrInputException>().With.Message.EqualTo(MessageFormatUtil.Format(PdfOcrExceptionMessageConstant.CANNOT_READ_INPUT_IMAGE)))
87-
;
81+
Exception exception = NUnit.Framework.Assert.Catch(typeof(PdfOcrInputException), () => PdfCreatorUtil.GetImageData
82+
(new FileInfo(PdfHelper.GetImagesTestDirectory() + "corrupted.jpg"), null));
83+
NUnit.Framework.Assert.AreEqual(MessageFormatUtil.Format(PdfOcrExceptionMessageConstant.CANNOT_READ_INPUT_IMAGE
84+
), exception.Message);
8885
}
8986
}
9087
}

itext.tests/itext.pdfocr.api.tests/itext/pdfocr/PdfFontTest.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public virtual void TestFontColor() {
5757
[LogMessage(PdfOcrExceptionMessageConstant.CANNOT_CREATE_PDF_DOCUMENT, Count = 1)]
5858
[NUnit.Framework.Test]
5959
public virtual void TestInvalidFontWithInvalidDefaultFontFamily() {
60-
NUnit.Framework.Assert.That(() => {
60+
Exception exception = NUnit.Framework.Assert.Catch(typeof(PdfOcrException), () => {
6161
String testName = "testInvalidFontWithInvalidDefaultFontFamily";
6262
String path = PdfHelper.GetDefaultImagePath();
6363
String pdfPath = PdfHelper.GetTargetDirectory() + testName + ".pdf";
@@ -72,8 +72,9 @@ public virtual void TestInvalidFontWithInvalidDefaultFontFamily() {
7272
NUnit.Framework.Assert.AreEqual(PdfHelper.DEFAULT_TEXT, result);
7373
NUnit.Framework.Assert.AreEqual(ScaleMode.SCALE_TO_FIT, properties.GetScaleMode());
7474
}
75-
, NUnit.Framework.Throws.InstanceOf<PdfOcrException>().With.Message.EqualTo(MessageFormatUtil.Format(PdfOcrExceptionMessageConstant.CANNOT_CREATE_PDF_DOCUMENT, PdfOcrExceptionMessageConstant.CANNOT_RESOLVE_PROVIDED_FONTS)))
76-
;
75+
);
76+
NUnit.Framework.Assert.AreEqual(MessageFormatUtil.Format(PdfOcrExceptionMessageConstant.CANNOT_CREATE_PDF_DOCUMENT
77+
, PdfOcrExceptionMessageConstant.CANNOT_RESOLVE_PROVIDED_FONTS), exception.Message);
7778
}
7879

7980
[NUnit.Framework.Test]

itext.tests/itext.pdfocr.api.tests/itext/pdfocr/helpers/CustomOcrEngine.cs

+4
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ public virtual void CreateTxtFile(IList<FileInfo> inputImages, FileInfo txtFile,
6161
) {
6262
}
6363

64+
public virtual bool IsTaggingSupported() {
65+
return false;
66+
}
67+
6468
public virtual OcrEngineProperties GetOcrEngineProperties() {
6569
return ocrEngineProperties;
6670
}

itext.tests/itext.pdfocr.api.tests/itext/pdfocr/helpers/CustomProductAwareOcrEngine.cs

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ public virtual void CreateTxtFile(IList<FileInfo> inputImages, FileInfo txtFile,
5050
) {
5151
}
5252

53+
public virtual bool IsTaggingSupported() {
54+
return true;
55+
}
56+
5357
public virtual OcrEngineProperties GetOcrEngineProperties() {
5458
return null;
5559
}

itext.tests/itext.pdfocr.api.tests/itext/pdfocr/helpers/PdfHelper.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,13 @@ public static String GetTargetDirectory() {
8484

8585
/// <summary>Create pdfWriter using provided path to destination file.</summary>
8686
public static PdfWriter GetPdfWriter(String pdfPath) {
87-
return new PdfWriter(pdfPath, new WriterProperties().AddUAXmpMetadata());
87+
return new PdfWriter(pdfPath, new WriterProperties().AddPdfUaXmpMetadata(PdfUAConformance.PDF_UA_1));
8888
}
8989

9090
/// <summary>Create pdfWriter.</summary>
9191
public static PdfWriter GetPdfWriter() {
92-
return new PdfWriter(new MemoryStream(), new WriterProperties().AddUAXmpMetadata());
92+
return new PdfWriter(new MemoryStream(), new WriterProperties().AddPdfUaXmpMetadata(PdfUAConformance.PDF_UA_1
93+
));
9394
}
9495

9596
/// <summary>Creates PDF rgb output intent for tests.</summary>

0 commit comments

Comments
 (0)