Skip to content

Commit

Permalink
[RELEASE] iText 7 pdfOCR 2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
iText-CI committed Oct 11, 2022
2 parents 30396de + f71835b commit cd3d34e
Show file tree
Hide file tree
Showing 100 changed files with 188 additions and 169 deletions.
2 changes: 1 addition & 1 deletion pdfocr-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.itextpdf</groupId>
<artifactId>pdfocr-root</artifactId>
<version>2.0.1</version>
<version>2.0.2</version>
</parent>

<artifactId>pdfocr-api</artifactId>
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-2021 iText Group NV
Copyright (c) 1998-2022 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-2021 iText Group NV
Copyright (c) 1998-2022 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-2021 iText Group NV
Copyright (c) 1998-2022 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-2021 iText Group NV
Copyright (c) 1998-2022 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-2021 iText Group NV
Copyright (c) 1998-2022 iText Group NV
Authors: iText Software.
This program is offered under a commercial and under the AGPL license.
Expand All @@ -26,6 +26,9 @@ This file is part of the iText (R) project.
import java.util.Collections;
import java.util.List;

/**
* This class contains additional properties for ocr engine.
*/
public class OcrEngineProperties {

/**
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-2021 iText Group NV
Copyright (c) 1998-2022 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-2021 iText Group NV
Copyright (c) 1998-2022 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-2021 iText Group NV
Copyright (c) 1998-2022 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-2021 iText Group NV
Copyright (c) 1998-2022 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-2021 iText Group NV
Copyright (c) 1998-2022 iText Group NV
Authors: iText Software.
This program is offered under a commercial and under the AGPL license.
Expand Down Expand Up @@ -174,7 +174,6 @@ static com.itextpdf.kernel.geom.Point calculateImageCoordinates(
* @return list of {@link com.itextpdf.io.image.ImageData} objects
* (more than one element in the list if it is a multipage tiff)
* @throws PdfOcrException if error occurred during reading a file
* @throws IOException if error occurred during reading a file
*/
static List<ImageData> getImageData(final File inputImage, IImageRotationHandler imageRotationHandler)
throws PdfOcrException {
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-2021 iText Group NV
Copyright (c) 1998-2022 iText Group NV
Authors: iText Software.
This program is offered under a commercial and under the AGPL license.
Expand Down Expand Up @@ -34,6 +34,9 @@ This file is part of the iText (R) project.
import java.io.InputStream;
import org.slf4j.LoggerFactory;

/**
* {@link FontProvider} extension for ocr engine.
*/
public class PdfOcrFontProvider extends FontProvider {

/**
Expand All @@ -55,8 +58,12 @@ public PdfOcrFontProvider() {
this.addFont(getDefaultFont(), PdfEncodings.IDENTITY_H);
}


/**
* Creates a new {@link PdfOcrFontProvider} instance.
* Creates a new {@link PdfOcrFontProvider} instance based on provided {@link FontSet} instance and font family.
*
* @param fontSet {@link FontSet} instance
* @param defaultFontFamily font family
*/
public PdfOcrFontProvider(FontSet fontSet,
String defaultFontFamily) {
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-2021 iText Group NV
Copyright (c) 1998-2022 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-2021 iText Group NV
Copyright (c) 1998-2022 iText Group NV
Authors: iText Software.
This program is offered under a commercial and under the AGPL license.
Expand Down
2 changes: 1 addition & 1 deletion pdfocr-api/src/main/java/com/itextpdf/pdfocr/TextInfo.java
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-2021 iText Group NV
Copyright (c) 1998-2022 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-2021 iText Group NV
Copyright (c) 1998-2022 iText Group NV
Authors: iText Software.
This program is offered under a commercial and under the AGPL license.
Expand Down Expand Up @@ -80,6 +80,8 @@ public String getMessage() {

/**
* Gets additional params for Exception message.
*
* @return params for exception message
*/
protected Object[] getMessageParams() {
Object[] parameters = new Object[this.messageParams.size()];
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-2021 iText Group NV
Copyright (c) 1998-2022 iText Group NV
Authors: iText Software.
This program is offered under a commercial and under the AGPL license.
Expand All @@ -22,6 +22,9 @@ This file is part of the iText (R) project.
*/
package com.itextpdf.pdfocr.exceptions;

/**
* Class that bundles all the exception message templates as constants.
*/
public class PdfOcrExceptionMessageConstant {

public static final String CANNOT_READ_INPUT_IMAGE = "Cannot read input image";
Expand All @@ -34,4 +37,4 @@ public class PdfOcrExceptionMessageConstant {
private PdfOcrExceptionMessageConstant() {
//Private constructor will prevent the instantiation of this class directly
}
}
}
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-2021 iText Group NV
Copyright (c) 1998-2022 iText Group NV
Authors: iText Software.
This program is offered under a commercial and under the AGPL license.
Expand Down Expand Up @@ -59,4 +59,4 @@ public PdfOcrInputException(Throwable e) {
super(e);
}

}
}
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-2021 iText Group NV
Copyright (c) 1998-2022 iText Group NV
Authors: iText Software.
This program is offered under a commercial and under the AGPL license.
Expand All @@ -22,23 +22,35 @@ This file is part of the iText (R) project.
*/
package com.itextpdf.pdfocr.logs;

/**
* Class that bundles all the log message templates as constants.
*/
public class PdfOcrLogMessageConstant {

/** The constant CANNOT_READ_INPUT_IMAGE. */
public static final String CANNOT_READ_INPUT_IMAGE = "Cannot read input image {0}";

/** The constant PROVIDED_FONT_PROVIDER_IS_INVALID. */
public static final String PROVIDED_FONT_PROVIDER_IS_INVALID =
"Provided FontProvider is invalid. Please check that it contains valid fonts and default font family name.";

/** The constant CANNOT_READ_DEFAULT_FONT. */
public static final String CANNOT_READ_DEFAULT_FONT = "Cannot default read font: {0}";

/** The constant CANNOT_ADD_DATA_TO_PDF_DOCUMENT. */
public static final String CANNOT_ADD_DATA_TO_PDF_DOCUMENT = "Cannot add data to PDF document: {1}";

/** The constant START_OCR_FOR_IMAGES. */
public static final String START_OCR_FOR_IMAGES = "Starting ocr for {0} image(s)";

/** The constant NUMBER_OF_PAGES_IN_IMAGE. */
public static final String NUMBER_OF_PAGES_IN_IMAGE = "Image {0} contains {1} page(s)";

/** The constant COULD_NOT_FIND_CORRESPONDING_GLYPH_TO_UNICODE_CHARACTER. */
public static final String COULD_NOT_FIND_CORRESPONDING_GLYPH_TO_UNICODE_CHARACTER =
"Could not find a glyph corresponding to Unicode character {0} in any of the fonts";

/** The constant PDF_LANGUAGE_PROPERTY_IS_NOT_SET. */
public static final String PDF_LANGUAGE_PROPERTY_IS_NOT_SET = "PDF language property is not set";

private PdfOcrLogMessageConstant() {
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-2021 iText Group NV
Copyright (c) 1998-2022 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-2021 iText Group NV
Copyright (c) 1998-2022 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-2021 iText Group NV
Copyright (c) 1998-2022 iText Group NV
Authors: iText Software.
This program is offered under a commercial and under the AGPL license.
Expand Down
2 changes: 1 addition & 1 deletion pdfocr-api/src/test/java/com/itextpdf/pdfocr/ApiTest.java
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-2021 iText Group NV
Copyright (c) 1998-2022 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-2021 iText Group NV
Copyright (c) 1998-2022 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-2021 iText Group NV
Copyright (c) 1998-2022 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-2021 iText Group NV
Copyright (c) 1998-2022 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-2021 iText Group NV
Copyright (c) 1998-2022 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-2021 iText Group NV
Copyright (c) 1998-2022 iText Group NV
Authors: iText Software.
This program is offered under a commercial and under the AGPL license.
Expand Down
Loading

0 comments on commit cd3d34e

Please sign in to comment.