public class PdfFormatConversionOptions extends Object
represents set of options for convert PDF document
Modifier and Type | Class and Description |
---|---|
static class |
PdfFormatConversionOptions.PdfANonSpecificationFlags
This class holds flags to control PDF/A conversion for cases when source PDF document doesn't
correspond to PDF specification.
|
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.
|
Constructor and Description |
---|
PdfFormatConversionOptions(OutputStream outputLogStream,
PdfFormat format,
int action)
Constructor
|
PdfFormatConversionOptions(PdfFormat format)
Constructor
|
PdfFormatConversionOptions(PdfFormat format,
int action)
Constructor
|
PdfFormatConversionOptions(String outputLogFileName,
PdfFormat format)
Constructor
|
PdfFormatConversionOptions(String outputLogFileName,
PdfFormat format,
int action)
Constructor
|
PdfFormatConversionOptions(String outputLogFileName,
PdfFormat format,
int action,
int transparencyAction)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addNotAccessibleFont(String fontName) |
byte |
getAlignStrategy()
Strategy to align text.
|
boolean |
getAlignText()
This flag controls text alignment in converted document.
|
int |
getConvertSoftMaskAction()
Action for images with soft mask.
|
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.
|
PdfFormat |
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 |
isAsyncImageStreamsConversionMode()
Gets/sets run of image streams in async mode.
|
boolean |
isLowMemoryMode()
Is low memory conversion mode enabled
|
boolean |
isPageByPageFontProcess()
Is font analyse on page by page basis mode enabled
|
boolean |
isTransferInfo()
Gets or sets whether to pass data from Info to Metadata when converted to PDF 2.0.
|
boolean |
isTransparencyIgnore()
Default value FALSE and transparency color will be proceed to keep document appearance.
|
void |
setAlignStrategy(byte alignStrategy)
Strategy to align text.
|
void |
setAlignText(boolean value)
This flag controls text alignment in converted document.
|
void |
setAsyncImageStreamsConversionMode(boolean value)
Gets/sets run of image streams in async mode.
|
void |
setConvertSoftMaskAction(int value)
Action for images with soft mask.
|
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(PdfFormat 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 |
setPageByPageFontProcess(boolean b)
Set font analyse on page by page basis mode enabled
|
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 |
setTransferInfo(boolean value)
Gets or sets whether to pass data from Info to Metadata when converted to PDF 2.0.
|
void |
setTransparencyAction(int value)
Action for image masked objects
|
void |
setTransparencyIgnore(boolean value)
Default value FALSE and transparency color will be proceed to keep document appearance.
|
void |
setTransparencyResolution(int dpi)
Sets resolution during converting transparent images.
|
void |
setUnicodeProcessingRules(ToUnicodeProcessingRules value)
Rules to solve problems with unicode mapping.
|
public PdfFormatConversionOptions(String outputLogFileName, PdfFormat 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, PdfFormat format)
Constructor
outputLogFileName
- Path to file where comments will be stored.format
- The pdf format.PdfFormat
public PdfFormatConversionOptions(PdfFormat format)
Constructor
format
- The pdf format.PdfFormat
public PdfFormatConversionOptions(PdfFormat format, int action)
Constructor
format
- The pdf format.action
- Action for objects that can not be convertedPdfFormat
,
ConvertErrorAction
public PdfFormatConversionOptions(String outputLogFileName, PdfFormat 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, PdfFormat format, int action)
Constructor
outputLogStream
- Stream where comments will be storedformat
- The pdf formataction
- Action for objects that can not be convertedPdfFormat
,
ConvertErrorAction
public final boolean isAsyncImageStreamsConversionMode()
Gets/sets run of image streams in async mode.
public final void setAsyncImageStreamsConversionMode(boolean value)
Gets/sets run of image streams in async mode.
value
- boolean valuepublic final boolean isLowMemoryMode()
Is low memory conversion mode enabled
public void setLowMemoryMode(boolean value)
Is low memory conversion mode enabled
value
- boolean valuepublic PdfFormat getFormat()
PDF format.
PdfFormat
public void setFormat(PdfFormat 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 boolean isTransparencyIgnore()
Default value FALSE and transparency color will be proceed to keep document appearance. With value TRUE transparency color will be converted into non-transparency, some objects could be covered.
public void setTransparencyIgnore(boolean value)
Default value FALSE and transparency color will be proceed to keep document appearance. With value TRUE transparency color will be converted into non-transparency, some objects could be covered.
value
- boolean valuepublic final int getConvertSoftMaskAction()
Action for images with soft mask.
public final void setConvertSoftMaskAction(int value)
Action for images with soft mask.
value
- int valuepublic 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 final boolean isTransferInfo()
Gets or sets whether to pass data from Info to Metadata when converted to PDF 2.0. True by default.
public final void setTransferInfo(boolean value)
Gets or sets whether to pass data from Info to Metadata when converted to PDF 2.0. True by default.
value
- boolean valuepublic 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 setPageByPageFontProcess(boolean b)
Set font analyse on page by page basis mode enabled
Default value = falseb
- boolean valuepublic boolean isPageByPageFontProcess()
Is font analyse on page by page basis mode enabled
Default value = falsepublic byte getAlignStrategy()
Strategy to align text. This parameter has sense only when flag AlignText
is set to
true.
PdfFormatConversionOptions.SegmentAlignStrategy
public void setAlignStrategy(byte alignStrategy)
Strategy to align text. This parameter has sense only when flag AlignText
is set to
true.
alignStrategy
- SegmentAlignStrategy elementPdfFormatConversionOptions.SegmentAlignStrategy
public void addNotAccessibleFont(String fontName)
Copyright © 2023 Aspose. All Rights Reserved.