public class OcrPdfCreatorProperties extends Object
OcrPdfCreator
.
Constructor and Description |
---|
OcrPdfCreatorProperties()
Creates a new OcrPdfCreatorProperties instance.
|
OcrPdfCreatorProperties(OcrPdfCreatorProperties other)
Creates a new OcrPdfCreatorProperties instance based on another OcrPdfCreatorProperties instance (copy constructor).
|
Modifier and Type | Method and Description |
---|---|
String |
getDefaultFontFamily()
Gets preferred font family to be used when selecting font from FontProvider .
|
com.itextpdf.layout.font.FontProvider |
getFontProvider()
Returns FontProvider that was set previously or if it is null
|
String |
getImageLayerName()
Gets name of image layer.
|
com.itextpdf.kernel.geom.Rectangle |
getPageSize()
Gets required size for output PDF document.
|
String |
getPdfLang()
Gets PDF language.
|
ScaleMode |
getScaleMode()
Gets scale mode for input images using available options from ScaleMode enumeration.
|
com.itextpdf.kernel.colors.Color |
getTextColor()
Gets text color in output PDF document.
|
String |
getTextLayerName()
Gets name of text layer.
|
String |
getTitle()
Gets PDF document title.
|
OcrPdfCreatorProperties |
setFontProvider(com.itextpdf.layout.font.FontProvider fontProvider)
Sets font provider.
|
OcrPdfCreatorProperties |
setFontProvider(com.itextpdf.layout.font.FontProvider fontProvider, String defaultFontFamily)
Sets font provider and default font family.
|
OcrPdfCreatorProperties |
setImageLayerName(String layerName)
Sets name for the image layer.
|
OcrPdfCreatorProperties |
setPageSize(com.itextpdf.kernel.geom.Rectangle pageSize)
Sets required size for output PDF document.
|
OcrPdfCreatorProperties |
setPdfLang(String language)
Specify PDF natural language, and optionally locale.
|
OcrPdfCreatorProperties |
setScaleMode(ScaleMode scaleMode)
Sets scale mode for input images using available options from ScaleMode enumeration.
|
OcrPdfCreatorProperties |
setTextColor(com.itextpdf.kernel.colors.Color textColor)
Sets text color in output PDF document.
|
OcrPdfCreatorProperties |
setTextLayerName(String layerName)
Sets name for the text layer.
|
OcrPdfCreatorProperties |
setTitle(String title)
Sets PDF document title.
|
public OcrPdfCreatorProperties()
OcrPdfCreatorProperties
instance.
public OcrPdfCreatorProperties(OcrPdfCreatorProperties other)
OcrPdfCreatorProperties
instance based on another OcrPdfCreatorProperties
instance (copy constructor).
other
- the other OcrPdfCreatorProperties
instance
public final com.itextpdf.kernel.colors.Color getTextColor()
Color
public final OcrPdfCreatorProperties setTextColor(com.itextpdf.kernel.colors.Color textColor)
textColor
- required text Color
OcrPdfCreatorProperties
instance
public final ScaleMode getScaleMode()
ScaleMode
enumeration.
ScaleMode
public final OcrPdfCreatorProperties setScaleMode(ScaleMode scaleMode)
ScaleMode
enumeration.
scaleMode
- selected ScaleMode
OcrPdfCreatorProperties
instance
public final com.itextpdf.kernel.geom.Rectangle getPageSize()
ScaleMode
Rectangle
public final OcrPdfCreatorProperties setPageSize(com.itextpdf.kernel.geom.Rectangle pageSize)
pageSize
- requested page size as Rectangle
OcrPdfCreatorProperties
instance
public final String getImageLayerName()
String
if it was manually set, otherwise - null
public final OcrPdfCreatorProperties setImageLayerName(String layerName)
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.
layerName
- name of the image layer as String
OcrPdfCreatorProperties
instance
public final String getTextLayerName()
String
if it was manually set, otherwise - null
public final OcrPdfCreatorProperties setTextLayerName(String layerName)
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.
layerName
- of the text layer as String
OcrPdfCreatorProperties
instance
public final String getPdfLang()
String
public final OcrPdfCreatorProperties setPdfLang(String language)
language
- PDF document language as String
, e.g. "en-US", etc.
OcrPdfCreatorProperties
instance
public final OcrPdfCreatorProperties setTitle(String title)
title
- PDF title as String
OcrPdfCreatorProperties
instance
public com.itextpdf.layout.font.FontProvider getFontProvider()
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
Copyright © 1998–2020 iText Group NV. All rights reserved.