Class OcrPdfCreatorProperties

java.lang.Object
com.itextpdf.pdfocr.OcrPdfCreatorProperties

public class OcrPdfCreatorProperties extends Object
Properties that will be used by the OcrPdfCreator.
  • Constructor Details

  • Method Details

    • getTextColor

      public final com.itextpdf.kernel.colors.Color getTextColor()
      Gets text color in output PDF document.
      Returns:
      set text Color
    • setTextColor

      public final OcrPdfCreatorProperties setTextColor (com.itextpdf.kernel.colors.Color textColor)
      Sets text color in output PDF document. Text will be transparent by default.
      Parameters:
      textColor - required text Color
      Returns:
      the OcrPdfCreatorProperties instance
    • getScaleMode

      public final ScaleMode getScaleMode()
      Gets scale mode for input images using available options from ScaleMode enumeration.
      Returns:
      selected ScaleMode
    • setScaleMode

      public final OcrPdfCreatorProperties setScaleMode (ScaleMode scaleMode)
      Sets scale mode for input images using available options from ScaleMode enumeration.
      Parameters:
      scaleMode - selected ScaleMode
      Returns:
      the OcrPdfCreatorProperties instance
    • getPageSize

      public final com.itextpdf.kernel.geom.Rectangle getPageSize()
      Gets required size for output PDF document. Real size of the page will be calculated according to the selected ScaleMode
      Returns:
      required page size as Rectangle
    • setPageSize

      public final OcrPdfCreatorProperties setPageSize (com.itextpdf.kernel.geom.Rectangle pageSize)
      Sets required size for output PDF document.
      Parameters:
      pageSize - requested page size as Rectangle
      Returns:
      the OcrPdfCreatorProperties instance
    • getImageLayerName

      public final String getImageLayerName()
      Gets name of image layer.
      Returns:
      image layer's name as String if it was manually set, otherwise - null
    • setImageLayerName

      public final OcrPdfCreatorProperties setImageLayerName (String layerName)
      Sets name for the image layer. null by default. If null then image is placed directly in canvas instead of layer. If image layer name is equal to text layer name then text and image placed in one layer.
      Parameters:
      layerName - name of the image layer as String
      Returns:
      the OcrPdfCreatorProperties instance
    • getTextLayerName

      public final String getTextLayerName()
      Gets name of text layer.
      Returns:
      text layer's name as String if it was manually set, otherwise - null
    • setTextLayerName

      public final OcrPdfCreatorProperties setTextLayerName (String layerName)
      Sets name for the text layer. null by default. If null then text is placed directly in canvas instead of layer. If text layer name is equal to image layer name then text and image placed in one layer.
      Parameters:
      layerName - of the text layer as String
      Returns:
      the OcrPdfCreatorProperties instance
    • getPdfLang

      public final String getPdfLang()
      Gets PDF language.
      Returns:
      PDF document language as String
    • setPdfLang

      public final OcrPdfCreatorProperties setPdfLang (String language)
      Specify PDF natural language, and optionally locale. Language identifier shall either be the empty text string, to indicate that the language is unknown, or a Language-Tag as defined in BCP 47 (2009), Tags for the Identification of Languages.
      Parameters:
      language - PDF document language as String, e.g. "en-US", etc.
      Returns:
      the OcrPdfCreatorProperties instance
    • getTitle

      public final String getTitle()
      Gets PDF document title.
      Returns:
      PDF title as String
    • setTitle

      public final OcrPdfCreatorProperties setTitle (String title)
      Sets PDF document title.
      Parameters:
      title - PDF title as String
      Returns:
      the OcrPdfCreatorProperties instance
    • getFontProvider

      public com.itextpdf.layout.font.FontProvider getFontProvider()
      Returns FontProvider that was set previously or if it is null a new instance of PdfOcrFontProvider is returned.
      Returns:
      FontProvider object
    • setFontProvider

      public OcrPdfCreatorProperties setFontProvider (com.itextpdf.layout.font.FontProvider fontProvider)
      Sets font provider. Please note that passed FontProvider is not to be used in multithreaded environments or for any parallel processing. There will be set the following default font family: PdfOcrFontProvider.getDefaultFontFamily()
      Parameters:
      fontProvider - selected FontProvider instance
      Returns:
      the OcrPdfCreatorProperties instance
    • setFontProvider

      public OcrPdfCreatorProperties setFontProvider (com.itextpdf.layout.font.FontProvider fontProvider, String defaultFontFamily)
      Sets font provider and default font family. Please note that passed FontProvider is not to be used in multithreaded environments or for any parallel processing.
      Parameters:
      fontProvider - selected FontProvider instance
      defaultFontFamily - preferred font family to be used when selecting font from FontProvider.
      Returns:
      the OcrPdfCreatorProperties instance
    • getDefaultFontFamily

      public String getDefaultFontFamily()
      Gets preferred font family to be used when selecting font from FontProvider.
      Returns:
      if default font family is not set or it is null or empty PdfOcrFontProvider.getDefaultFontFamily() is returned
    • getImageRotationHandler

      public IImageRotationHandler getImageRotationHandler()
      Gets image rotation handler instance.
      Returns:
      image rotation handler
    • setImageRotationHandler

      public OcrPdfCreatorProperties setImageRotationHandler (IImageRotationHandler imageRotationDetector)
      Sets image rotation handler instance. If not set - image rotation handling is not applied.
      Parameters:
      imageRotationDetector - image rotation handler instance
      Returns:
      the OcrPdfCreatorProperties instance
    • setTagged

      public OcrPdfCreatorProperties setTagged (boolean tagged)
      Defines whether pdf document should be tagged or not.
      Parameters:
      tagged - true if the result pdf is expected to be tagged, false otherwise.
      Returns:
      this OcrPdfCreatorProperties instance.
    • isTagged

      public boolean isTagged()
      Retrieve information on whether pdf document should be tagged or not.
      Returns:
      true if the result pdf is expected to be tagged, false otherwise.
    • setMetaInfo

      public OcrPdfCreatorProperties setMetaInfo (com.itextpdf.commons.actions.contexts.IMetaInfo metaInfo)
      Set meta info for this OcrPdfCreatorProperties.
      Parameters:
      metaInfo - meta info
      Returns:
      the instance of the current OcrPdfCreatorProperties