public class PdfFormatConversionOptions extends Object
represents set of options for convert PDF document
Modifier and Type | Class and Description |
---|---|
static class |
PdfFormatConversionOptions.PdfANonSpecificationFlags |
static class |
PdfFormatConversionOptions.PuaProcessingStrategy
Some PDF documents have special unicode symbols, which are belonged to Private Use Area
(PUA), see description at https://en.wikipedia.org/wiki/Private_Use_Areas.
|
static class |
PdfFormatConversionOptions.RemoveFontsStrategy
Some documens have large size after converison into PDF/A format.
|
static class |
PdfFormatConversionOptions.SegmentAlignStrategy
Describes strategies used to align document text segments.
|
Modifier and Type | Field and Description |
---|---|
byte |
AlignStrategy
Strategy to align text.
|
Constructor and Description |
---|
PdfFormatConversionOptions(int format)
Constructor
|
PdfFormatConversionOptions(int format,
int action)
Constructor
|
PdfFormatConversionOptions(OutputStream outputLogStream,
int format,
int action)
Constructor
|
PdfFormatConversionOptions(String outputLogFileName,
int format)
Constructor
|
PdfFormatConversionOptions(String outputLogFileName,
int format,
int action)
Constructor
|
PdfFormatConversionOptions(String outputLogFileName,
int format,
int action,
int transparencyAction)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addNotAccessibleFont(String fontName) |
boolean |
getAlignText()
This flag controls text alignment in converted document.
|
static PdfFormatConversionOptions |
getDefault()
Gets PdfFormatConversionOptions object with default parameters
|
int |
getErrorAction()
Action for objects that can not be converted
|
byte |
getExcludeFontsStrategy()
Strategy(ies) to exclude superfluous fonts and reduce document file size.
|
FontEmbeddingOptions |
getFontEmbeddingOptions()
Options for cases when it's not possible to embed some fonts into PDF document.
|
int |
getFormat()
PDF format.
|
String |
getIccProfileFileName()
Gets the filename of icc profile name.
|
String |
getLogFileName()
Path to file where comments will be stored.
|
OutputStream |
getLogStream()
Stream where comments will be stored.
|
PdfFormatConversionOptions.PdfANonSpecificationFlags |
getNonSpecificationCases()
Holds flags to control PDF/A conversion process for cases when source document doesn't
correspond to PDF/A specification.
|
String[] |
getNotAccessibleFonts()
This property is out-property.
|
boolean |
getOptimizeFileSize()
Gets a flag which enables/disables special conversion mode to get PDF/A document with reduced
file size.
|
int |
getPuaTextProcessingStrategy()
Strategy to process symbols from unicode Private Use Area (PUA).
|
PdfASymbolicFontEncodingStrategy |
getSymbolicFontEncodingStrategy()
Strategy to copy encoding data for symbolic fonts if symbolic TrueType font has more than one
encoding subtable.
|
int |
getTransparencyAction()
Action for image masked objects
|
int |
getTransparencyResolution()
Sets resolution during converting transparent images.
|
ToUnicodeProcessingRules |
getUnicodeProcessingRules()
Rules to solve problems with unicode mapping.
|
boolean |
isLowMemoryMode()
Is low memory conversion mode enabled
|
void |
setAlignText(boolean value)
This flag controls text alignment in converted document.
|
void |
setErrorAction(int value)
Action for objects that can not be converted
|
void |
setExcludeFontsStrategy(byte value)
Strategy(ies) to exclude superfluous fonts and reduce document file size.
|
void |
setFormat(int value)
PDF format.
|
void |
setIccProfileFileName(String value)
Sets the filename of icc profile name.
|
void |
setLogFileName(String value)
Path to file where comments will be stored.
|
void |
setLogStream(OutputStream value)
Stream where comments will be stored.
|
void |
setLowMemoryMode(boolean value)
Is low memory conversion mode enabled
|
void |
setOptimizeFileSize(boolean value)
Sets a flag which enables/disables special conversion mode to get PDF/A document with reduced
file size.
|
void |
setPuaTextProcessingStrategy(int value)
Strategy to process symbols from unicode Private Use Area (PUA).
|
void |
setSymbolicFontEncodingStrategy(PdfASymbolicFontEncodingStrategy value)
Strategy to copy encoding data for symbolic fonts if symbolic TrueType font has more than one
encoding subtable.
|
void |
setTransparencyAction(int value)
Action for image masked objects
|
void |
setTransparencyResolution(int dpi)
Sets resolution during converting transparent images.
|
void |
setUnicodeProcessingRules(ToUnicodeProcessingRules value)
Rules to solve problems with unicode mapping.
|
public byte AlignStrategy
Strategy to align text. This parameter has sense only when flag AlignText
is set to
true.
public PdfFormatConversionOptions(String outputLogFileName, int format, int action)
Constructor
outputLogFileName
- Path to file where comments will be stored.format
- The pdf format.action
- Action for objects that can not be convertedPdfFormat
,
ConvertErrorAction
public PdfFormatConversionOptions(String outputLogFileName, int format)
Constructor
outputLogFileName
- Path to file where comments will be stored.format
- The pdf format.PdfFormat
public PdfFormatConversionOptions(int format)
Constructor
format
- The pdf format.PdfFormat
public PdfFormatConversionOptions(int format, int action)
Constructor
format
- The pdf format.action
- Action for objects that can not be convertedPdfFormat
,
ConvertErrorAction
public PdfFormatConversionOptions(String outputLogFileName, int format, int action, int transparencyAction)
Constructor
outputLogFileName
- Path to file where comments will be stored.format
- The pdf format.action
- Action for objects that can not be convertedtransparencyAction
- Action for image masked objectsPdfFormat
,
ConvertErrorAction
,
ConvertTransparencyAction
public PdfFormatConversionOptions(OutputStream outputLogStream, int format, int action)
Constructor
outputLogStream
- Stream where comments will be storedformat
- The pdf formataction
- Action for objects that can not be convertedPdfFormat
,
ConvertErrorAction
public boolean isLowMemoryMode()
Is low memory conversion mode enabled
public void setLowMemoryMode(boolean value)
Is low memory conversion mode enabled
value
- boolean valuepublic int getFormat()
PDF format.
PdfFormat
public void setFormat(int value)
PDF format.
value
- PdfFormat elementPdfFormat
public String getLogFileName()
Path to file where comments will be stored.
public void setLogFileName(String value)
Path to file where comments will be stored.
value
- String objectpublic OutputStream getLogStream()
Stream where comments will be stored.
public void setLogStream(OutputStream value)
Stream where comments will be stored.
value
- OutputStream objectpublic int getErrorAction()
Action for objects that can not be converted
ConvertErrorAction
public void setErrorAction(int value)
Action for objects that can not be converted
value
- ConvertErrorAction elementConvertErrorAction
public int getTransparencyAction()
Action for image masked objects
ConvertTransparencyAction
public void setTransparencyAction(int value)
Action for image masked objects
value
- ConvertTransparencyAction elementConvertTransparencyAction
public static PdfFormatConversionOptions getDefault()
Gets PdfFormatConversionOptions object with default parameters
public PdfFormatConversionOptions.PdfANonSpecificationFlags getNonSpecificationCases()
Holds flags to control PDF/A conversion process for cases when source document doesn't correspond to PDF/A specification.
public PdfASymbolicFontEncodingStrategy getSymbolicFontEncodingStrategy()
Strategy to copy encoding data for symbolic fonts if symbolic TrueType font has more than one encoding subtable.
public void setSymbolicFontEncodingStrategy(PdfASymbolicFontEncodingStrategy value)
Strategy to copy encoding data for symbolic fonts if symbolic TrueType font has more than one encoding subtable.
value
- PdfASymbolicFontEncodingStrategy objectpublic boolean getAlignText()
This flag controls text alignment in converted document. By default document conversion doesn't affect text alignment and leave text as is. But in some cases font substitution causes text overlapping or extra spaces in converted document. When this flag is set special alignment operations will be performed. This flag should be set only for documents which have problems with overlapped text or extra text spaces cause using of this flag decrease performance and in some cases could corrupt text content.
public void setAlignText(boolean value)
This flag controls text alignment in converted document. By default document conversion doesn't affect text alignment and leave text as is. But in some cases font substitution causes text overlapping or extra spaces in converted document. When this flag is set special alignment operations will be performed. This flag should be set only for documents which have problems with overlapped text or extra text spaces cause using of this flag decrease performance and in some cases could corrupt text content.
value
- boolean valuepublic int getPuaTextProcessingStrategy()
Strategy to process symbols from unicode Private Use Area (PUA).
PdfFormatConversionOptions.PuaProcessingStrategy
public void setPuaTextProcessingStrategy(int value)
Strategy to process symbols from unicode Private Use Area (PUA).
value
- PuaProcessingStrategy elementPdfFormatConversionOptions.PuaProcessingStrategy
public boolean getOptimizeFileSize()
Gets a flag which enables/disables special conversion mode to get PDF/A document with reduced file size.
Now this flag impacts on optimization of fonts used in PDF document, possibly, in future, this flag also will be used to switch on optimization for another data structures, such as graphic.Set of this flag and mode could significantly reduce file size but at the same time it could significantly decrease performance of conversion.
public void setOptimizeFileSize(boolean value)
Sets a flag which enables/disables special conversion mode to get PDF/A document with reduced file size.
Now this flag impacts on optimization of fonts used in PDF document, possibly, in future, this flag also will be used to switch on optimization for another data structures, such as graphic.Set of this flag and mode could significantly reduce file size but at the same time it could significantly decrease performance of conversion.
value
- boolean valuepublic byte getExcludeFontsStrategy()
Strategy(ies) to exclude superfluous fonts and reduce document file size. This parameter has
sense only when flag OptimizeFileSize
is set to true. By default combination of
strategies SubsetFonts
and RemoveDuplicatedFonts
is used.
RemoveFontsStrategy
public void setExcludeFontsStrategy(byte value)
Strategy(ies) to exclude superfluous fonts and reduce document file size. This parameter has
sense only when flag OptimizeFileSize
is set to true. By default combination of
strategies SubsetFonts
and RemoveDuplicatedFonts
is used.
value
- boolean valuepublic FontEmbeddingOptions getFontEmbeddingOptions()
Options for cases when it's not possible to embed some fonts into PDF document.
public ToUnicodeProcessingRules getUnicodeProcessingRules()
Rules to solve problems with unicode mapping. Can be null.
public void setUnicodeProcessingRules(ToUnicodeProcessingRules value)
Rules to solve problems with unicode mapping. Can be null.
value
- ToUnicodeProcessingRules objectpublic String getIccProfileFileName()
Gets the filename of icc profile name. In case of null the default icc profile used.
public void setIccProfileFileName(String value)
Sets the filename of icc profile name. In case of null the default icc profile used.
value
- String objectpublic String[] getNotAccessibleFonts()
This property is out-property. It holds all the fonts(font names) which were not found on computer at last PDF/A conversion.
public int getTransparencyResolution()
Sets resolution during converting transparent images. The higher resolution, the slower converting speed. The default value is 300.
public void setTransparencyResolution(int dpi)
Sets resolution during converting transparent images. The higher resolution, the slower converting speed. The default value is 300.
dpi
- Resolution valuepublic void addNotAccessibleFont(String fontName)