public class OptimizationOptions extends Object
Class which describes document optimization algorithm. Instance of this class may be used as parameter of OptimizeResources() method.
Constructor and Description |
---|
OptimizationOptions() |
Modifier and Type | Method and Description |
---|---|
static OptimizationOptions |
all()
Creates optimization strategy will all options activated.
|
boolean |
getAllowReusePageContent()
If true page contents will be reused when document is optimized for equal pages.
|
boolean |
getCompressImages()
Deprecated.
Please use ImageCompressionOptions.CompressImages instead.
|
ImageCompressionOptions |
getImageCompressionOptions()
Set of options which describe will images in the document be compressed and parameters of the compression.
|
int |
getImageEncoding()
Image encodre which will be used.
|
int |
getImageQuality()
Deprecated.
Please use ImageCompressionOptions.ImageQuality instead.
|
boolean |
getLinkDuplcateStreams()
If this flag is set to true, Resource streams will be analyzed.
|
int |
getMaxResoultion()
Specifies maximum resolution of images.
|
boolean |
getRemovePrivateInfo()
Remove private information (page piece info).
|
boolean |
getRemoveUnusedObjects()
If this flag is set to true, all document objects will be checked and unused objects (i.e. objects which does
not have any reference) are removed from document.
|
boolean |
getRemoveUnusedStreams()
If this flag set to true, every resource is checked on it's usage.
|
boolean |
getResizeImages()
Deprecated.
Please use ImageCompressionOptions.ResizeImages instead.
|
boolean |
getSubsetFonts()
Fonts will be converted into subsets if set to true.
|
boolean |
getUnembedFonts()
Make fonts not embedded if set to true.
|
void |
setAllowReusePageContent(boolean value)
If true page contents will be reused when document is optimized for equal pages.
|
void |
setCompressImages(boolean value)
Deprecated.
Please use ImageCompressionOptions.CompressImages instead.
|
void |
setImageEncoding(int value)
Image encodre which will be used.
|
void |
setImageQuality(int value)
Deprecated.
Please use ImageCompressionOptions.ImageQuality instead.
|
void |
setLinkDuplcateStreams(boolean value)
If this flag is set to true, Resource streams will be analyzed.
|
void |
setMaxResoultion(int value)
Specifies maximum resolution of images.
|
void |
setRemovePrivateInfo(boolean value)
Remove private information (page piece info).
|
void |
setRemoveUnusedObjects(boolean value)
If this flag is set to true, all document objects will be checked and unused objects (i.e. objects which does
not have any reference) are removed from document.
|
void |
setRemoveUnusedStreams(boolean value)
If this flag set to true, every resource is checked on it's usage.
|
void |
setResizeImages(boolean value)
Deprecated.
Please use ImageCompressionOptions.ResizeImages instead.
|
void |
setSubsetFonts(boolean value)
Fonts will be converted into subsets if set to true.
|
void |
setUnembedFonts(boolean value)
Make fonts not embedded if set to true.
|
public final boolean getLinkDuplcateStreams()
If this flag is set to true, Resource streams will be analyzed. If duplicate streams are found (i.e. if stream contents is equal), then thes streams will be stored as one object. This allows to decrease document size in some cases (for example, when same document was concatenedted multiple times).
public final void setLinkDuplcateStreams(boolean value)
If this flag is set to true, Resource streams will be analyzed. If duplicate streams are found (i.e. if stream contents is equal), then thes streams will be stored as one object. This allows to decrease document size in some cases (for example, when same document was concatenedted multiple times).
value
- boolean valuepublic final boolean getAllowReusePageContent()
If true page contents will be reused when document is optimized for equal pages.
public final void setAllowReusePageContent(boolean value)
If true page contents will be reused when document is optimized for equal pages.
value
- boolean valuepublic final boolean getRemoveUnusedStreams()
If this flag set to true, every resource is checked on it's usage. If resource is never used, then resources is removed. This may decrease document size for example when pages were extracted from document.
public final void setRemoveUnusedStreams(boolean value)
If this flag set to true, every resource is checked on it's usage. If resource is never used, then resources is removed. This may decrease document size for example when pages were extracted from document.
value
- boolean valuepublic final boolean getRemoveUnusedObjects()
If this flag is set to true, all document objects will be checked and unused objects (i.e. objects which does not have any reference) are removed from document.
public final void setRemoveUnusedObjects(boolean value)
If this flag is set to true, all document objects will be checked and unused objects (i.e. objects which does not have any reference) are removed from document.
value
- boolean valuepublic final ImageCompressionOptions getImageCompressionOptions()
Set of options which describe will images in the document be compressed and parameters of the compression.
@Deprecated public final boolean getCompressImages()
If this flag is set to true images will be compressed in the document. compression level is specfied with ImageQuality property.
@Deprecated public final void setCompressImages(boolean value)
If this flag is set to true images will be compressed in the document. compression level is specfied with ImageQuality property.
value
- boolean value@Deprecated public final boolean getResizeImages()
If this flag set to true and CompressImages is true images will be resized if image resoultion is greater then specified MaxResolution parameter.
@Deprecated public final void setResizeImages(boolean value)
If this flag set to true and CompressImages is true images will be resized if image resoultion is greater then specified MaxResolution parameter.
value
- boolean value@Deprecated public final int getImageQuality()
Specifies level of image compression when CompressIamges flag is used.
@Deprecated public final void setImageQuality(int value)
Specifies level of image compression when CompressIamges flag is used.
value
- int valuepublic final int getMaxResoultion()
Specifies maximum resolution of images. If image has higher resolition it will be scaled
public final void setMaxResoultion(int value)
Specifies maximum resolution of images. If image has higher resolition it will be scaled
value
- int valuepublic final boolean getUnembedFonts()
Make fonts not embedded if set to true.
public final void setUnembedFonts(boolean value)
Make fonts not embedded if set to true.
value
- boolean valuepublic final boolean getSubsetFonts()
Fonts will be converted into subsets if set to true.
public final void setSubsetFonts(boolean value)
Fonts will be converted into subsets if set to true.
value
- boolean valuepublic final boolean getRemovePrivateInfo()
Remove private information (page piece info).
public final void setRemovePrivateInfo(boolean value)
Remove private information (page piece info).
value
- boolean valuepublic final int getImageEncoding()
Image encodre which will be used.
public final void setImageEncoding(int value)
Image encodre which will be used.
value
- ImageEncoding elementpublic static OptimizationOptions all()
Creates optimization strategy will all options activated. Please note that activated only options which does not change any functionality of the document. I.e. image compressing and fonts unembedding will not enabled (and can be embedded manually).