com.asprise.ocr

## Class Ocr.PropertyBuilder

- java.lang.Object
- - java.util.Dictionary<K,V>
  - - java.util.Hashtable<Object,Object>
    - - java.util.Properties
      - - com.asprise.ocr.Ocr.PropertyBuilder

- All Implemented Interfaces:
    Serializable, Cloneable, Map<Object,Object>
  Enclosing class:
    Ocr

      public static class Ocr.PropertyBuilder
      extends Properties

  Builder for configuring scan properties.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Ocr.PropertyBuilder()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Ocr.PropertyBuilder` | `saveIntermediateImagesToDir(File dir)` Save intermediate images generated for debug purpose - don't specify or empty string to skip saving
    `Ocr.PropertyBuilder` | `setCustomImagePreProcessing(String cmds)` set the image pre-processing type to Ocr.ImagePreProcessingType.CUSTOM and the corresponding custom commands.
    `Ocr.PropertyBuilder` | `setImagePreProcessingType(Ocr.ImagePreProcessingType type)` Sets the image pre-processing type
    `Ocr.PropertyBuilder` | `setInputPdfDpi(int dpi)` The DPI to be used to render the PDF file; default is 300 if not specified
    `Ocr.PropertyBuilder` | `setLimitToCharset(String chars)` recognizes only certain characters
    `Ocr.PropertyBuilder` | `setLimitToCharsetDigitsOnly()` only recognizes '0123456789'
    `Ocr.PropertyBuilder` | `setOutputSeparateWords(boolean enable)` whether to use word as the base unit for output; set to false to use the default unit: line.
    `Ocr.PropertyBuilder` | `setPageType(Ocr.PageType pageType)` hints the page type to the OCR engine
    `Ocr.PropertyBuilder` | `setPageType(String pageType)` hints the page type to the OCR engine
    `Ocr.PropertyBuilder` | `setPdfImageForceBlackWhite(boolean enable)` true to convert image in PDF to black/white to save space false for keeping as is (default).
    `Ocr.PropertyBuilder` | `setPdfOutputFile(File file)` Target pdf output file when output format is set to pdf
    `Ocr.PropertyBuilder` | `setPdfOutputFile(String filePath)` Target pdf output file when output format is set to pdf
    `Ocr.PropertyBuilder` | `setPdfOutputFontSans(boolean enable)` true to set PDF output font to Sans, false to Serif (default).
    `Ocr.PropertyBuilder` | `setPdfOutputReturnNothing()` Return neither plain text nor xml when the output format is set to PDF.
    `Ocr.PropertyBuilder` | `setPdfOutputReturnPlainText()` Return plain text when the output format is set to PDF.
    `Ocr.PropertyBuilder` | `setPdfOutputReturnXml()` Return xml when the output format is set to PDF.
    `Ocr.PropertyBuilder` | `setPdfTextVisible(boolean enable)` true to make text recognized visible on PDF or false for transparent (default).
    `Ocr.PropertyBuilder` | `setSkipTableDetection(boolean skipTableDetection)` Whether table detection should be skipped.
    `Ocr.PropertyBuilder` | `setTableDetectionMinSideLength(int minSideLength)` Sets the min side length of a table cell when table detection is enabled.

    - ### Methods inherited from class java.util.Properties

      `getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames`

    - ### Methods inherited from class java.util.Hashtable

      `clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, remove, size, toString, values`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Ocr.PropertyBuilder

          public Ocr.PropertyBuilder()

  - ### Method Detail

    - #### setPageType

          public Ocr.PropertyBuilder setPageType(Ocr.PageType pageType)

      hints the page type to the OCR engine

    - #### setPageType

          public Ocr.PropertyBuilder setPageType(String pageType)

      hints the page type to the OCR engine

    - #### setLimitToCharset

          public Ocr.PropertyBuilder setLimitToCharset(String chars)

      recognizes only certain characters

    - #### setLimitToCharsetDigitsOnly

          public Ocr.PropertyBuilder setLimitToCharsetDigitsOnly()

      only recognizes '0123456789'

    - #### setOutputSeparateWords

          public Ocr.PropertyBuilder setOutputSeparateWords(boolean enable)

      whether to use word as the base unit for output; set to false to use the default unit: line.

    - #### setInputPdfDpi

          public Ocr.PropertyBuilder setInputPdfDpi(int dpi)

      The DPI to be used to render the PDF file; default is 300 if not specified

    - #### setImagePreProcessingType

          public Ocr.PropertyBuilder setImagePreProcessingType(Ocr.ImagePreProcessingType type)

      Sets the image pre-processing type

    - #### setCustomImagePreProcessing

          public Ocr.PropertyBuilder setCustomImagePreProcessing(String cmds)

      set the image pre-processing type to Ocr.ImagePreProcessingType.CUSTOM and the corresponding custom commands.

    - #### setSkipTableDetection

          public Ocr.PropertyBuilder setSkipTableDetection(boolean skipTableDetection)

      Whether table detection should be skipped.

    - #### setTableDetectionMinSideLength

          public Ocr.PropertyBuilder setTableDetectionMinSideLength(int minSideLength)

      Sets the min side length of a table cell when table detection is enabled.

    - #### saveIntermediateImagesToDir

          public Ocr.PropertyBuilder saveIntermediateImagesToDir(File dir)

      Save intermediate images generated for debug purpose - don't specify or empty string to skip saving

    - #### setPdfOutputFile

          public Ocr.PropertyBuilder setPdfOutputFile(File file)

      Target pdf output file when output format is set to pdf

    - #### setPdfOutputFile

          public Ocr.PropertyBuilder setPdfOutputFile(String filePath)

      Target pdf output file when output format is set to pdf

    - #### setPdfOutputFontSans

          public Ocr.PropertyBuilder setPdfOutputFontSans(boolean enable)

      true to set PDF output font to Sans, false to Serif (default).

    - #### setPdfTextVisible

          public Ocr.PropertyBuilder setPdfTextVisible(boolean enable)

      true to make text recognized visible on PDF or false for transparent (default).

    - #### setPdfImageForceBlackWhite

          public Ocr.PropertyBuilder setPdfImageForceBlackWhite(boolean enable)

      true to convert image in PDF to black/white to save space false for keeping as is (default).

    - #### setPdfOutputReturnPlainText

          public Ocr.PropertyBuilder setPdfOutputReturnPlainText()

      Return plain text when the output format is set to PDF.

    - #### setPdfOutputReturnXml

          public Ocr.PropertyBuilder setPdfOutputReturnXml()

      Return xml when the output format is set to PDF.

    - #### setPdfOutputReturnNothing

          public Ocr.PropertyBuilder setPdfOutputReturnNothing()

      Return neither plain text nor xml when the output format is set to PDF.

Copyright © Asprise Software. All Rights Reserved. Please visit the product page at asprise.com