com.pdfunit.validators

## Class OCRValidator

- java.lang.Object
- - com.pdfunit.validators.AbstractValidator
  - - com.pdfunit.validators.AbstractPageValidator
    - - com.pdfunit.validators.OCRValidator

-     @DoNotObfuscate
      public final class OCRValidator
      extends com.pdfunit.validators.AbstractPageValidator

  This class provides several functions extracting text from images.
  Since:
    2016.05
  Author:
    Carsten Siedentop, January 2016

- - ### Field Summary

    - ### Fields inherited from class com.pdfunit.validators.AbstractPageValidator

      `effectedPageNumbers, pageScanFlag, pagesToUse, region`

    - ### Fields inherited from class com.pdfunit.validators.AbstractValidator

      `testDocument`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `OCRValidator(java.util.Collection<com.pdfunit.internal.spi.IImage> extractedImagesAllPages, Rotation rotation, FlipDirection flipDirection, ImageRegion imageRegion, ImageValidator backreference)`
    `protected` | `OCRValidator(java.util.Collection<com.pdfunit.internal.spi.IImage> extractedImagesAllPages, Rotation rotation, FlipDirection flipDirection, ImageValidator backreference)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `OCRValidator` | `containing(java.lang.String expectedText)` This method verifies that an extracted text from an image contains the specified text.
    `OCRValidator` | `endingWith(java.lang.String endString)` This method verifies that an extracted text from an image ends with the expected text.
    `OCRValidator` | `equalsTo(java.lang.String expectedText)` This method verifies that an extracted text from a region of an image contains the specified text.
    `java.util.Collection<com.pdfunit.internal.spi.IImage>` | `getExtractedImages()`
    `FlipDirection` | `getFlipDirection()`
    `ImageRegion` | `getImageRegion()`
    `Rotation` | `getRotation()`
    `OCRValidator` | `matchingRegex(java.lang.String regex)` This method verifies that an extracted text from an image matches the given regular expressiong.
    `OCRValidator` | `startingWith(java.lang.String startString)` This method verifies that an extracted text from an image starts with the expected text.

    - ### Methods inherited from class com.pdfunit.validators.AbstractPageValidator

      `createFullSizeRegionFromDocument, getEffectedPages, getPageScanFlag, setPagesToUse, setRegion`

    - ### Methods inherited from class com.pdfunit.validators.AbstractValidator

      `closeDocument, equals, getDocument, hashCode`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### OCRValidator

          protected OCRValidator(java.util.Collection<com.pdfunit.internal.spi.IImage> extractedImagesAllPages,
                      Rotation rotation,
                      FlipDirection flipDirection,
                      ImageValidator backreference)

    - #### OCRValidator

          protected OCRValidator(java.util.Collection<com.pdfunit.internal.spi.IImage> extractedImagesAllPages,
                      Rotation rotation,
                      FlipDirection flipDirection,
                      ImageRegion imageRegion,
                      ImageValidator backreference)

  - ### Method Detail

    - #### containing

          @Guarded
          public OCRValidator containing(java.lang.String expectedText)

      This method verifies that an extracted text from an image contains the specified text. Whitespaces will be normalized.

    - #### endingWith

          @Guarded
          public OCRValidator endingWith(java.lang.String endString)

      This method verifies that an extracted text from an image ends with the expected text. Whitespace will be taken as they are.

    - #### getExtractedImages

          public java.util.Collection<com.pdfunit.internal.spi.IImage> getExtractedImages()

    - #### getImageRegion

          public ImageRegion getImageRegion()

    - #### getFlipDirection

          public FlipDirection getFlipDirection()

    - #### getRotation

          public Rotation getRotation()

    - #### equalsTo

          @Guarded
          public OCRValidator equalsTo(java.lang.String expectedText)

      This method verifies that an extracted text from a region of an image contains the specified text. The given whitespace processing will be respected.

    - #### matchingRegex

          @Guarded
          public OCRValidator matchingRegex(java.lang.String regex)

      This method verifies that an extracted text from an image matches the given regular expressiong.

    - #### startingWith

          @Guarded
          public OCRValidator startingWith(java.lang.String startString)

      This method verifies that an extracted text from an image starts with the expected text. Whitespace will be taken as they are.

Copyright (C) PDFUnit.com. See here for license.