com.aspose.pdf.optimization

Class OptimizationOptions

  • Direct Known Subclasses:
    Document.OptimizationOptions


    public class OptimizationOptions
    extends Object

    Class which describes document optimization algorithm. Instance of this class may be used as parameter of OptimizeResources() method.

    • Constructor Detail

      • OptimizationOptions

        public OptimizationOptions()
    • Method Detail

      • getLinkDuplcateStreams

        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).

        Returns:
        boolean value
      • setLinkDuplcateStreams

        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).

        Parameters:
        value - boolean value
      • getAllowReusePageContent

        public final boolean getAllowReusePageContent()

        If true page contents will be reused when document is optimized for equal pages.

        Returns:
        boolean value
      • setAllowReusePageContent

        public final void setAllowReusePageContent(boolean value)

        If true page contents will be reused when document is optimized for equal pages.

        Parameters:
        value - boolean value
      • getRemoveUnusedStreams

        public 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.

        Returns:
        boolean value
      • setRemoveUnusedStreams

        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.

        Parameters:
        value - boolean value
      • getRemoveUnusedObjects

        public 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.

        Returns:
        boolean value
      • setRemoveUnusedObjects

        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.

        Parameters:
        value - boolean value
      • getImageCompressionOptions

        public final ImageCompressionOptions getImageCompressionOptions()

        Set of options which describe will images in the document be compressed and parameters of the compression.

        Returns:
        ImageCompressionOptions instance
      • getCompressImages

        @Deprecated
        public final boolean getCompressImages()
        Deprecated. Please use ImageCompressionOptions.CompressImages instead.

        If this flag is set to true images will be compressed in the document. compression level is specfied with ImageQuality property.

        Returns:
        boolean value
      • setCompressImages

        @Deprecated
        public final void setCompressImages(boolean value)
        Deprecated. Please use ImageCompressionOptions.CompressImages instead.

        If this flag is set to true images will be compressed in the document. compression level is specfied with ImageQuality property.

        Parameters:
        value - boolean value
      • getResizeImages

        @Deprecated
        public final boolean getResizeImages()
        Deprecated. Please use ImageCompressionOptions.ResizeImages instead.

        If this flag set to true and CompressImages is true images will be resized if image resoultion is greater then specified MaxResolution parameter.

        Returns:
        boolean value
      • setResizeImages

        @Deprecated
        public final void setResizeImages(boolean value)
        Deprecated. Please use ImageCompressionOptions.ResizeImages instead.

        If this flag set to true and CompressImages is true images will be resized if image resoultion is greater then specified MaxResolution parameter.

        Parameters:
        value - boolean value
      • getImageQuality

        @Deprecated
        public final int getImageQuality()
        Deprecated. Please use ImageCompressionOptions.ImageQuality instead.

        Specifies level of image compression when CompressIamges flag is used.

        Returns:
        int value
      • setImageQuality

        @Deprecated
        public final void setImageQuality(int value)
        Deprecated. Please use ImageCompressionOptions.ImageQuality instead.

        Specifies level of image compression when CompressIamges flag is used.

        Parameters:
        value - int value
      • getMaxResoultion

        public final int getMaxResoultion()

        Specifies maximum resolution of images. If image has higher resolition it will be scaled

        Returns:
        int value
      • setMaxResoultion

        public final void setMaxResoultion(int value)

        Specifies maximum resolution of images. If image has higher resolition it will be scaled

        Parameters:
        value - int value
      • getUnembedFonts

        public final boolean getUnembedFonts()

        Make fonts not embedded if set to true.

        Returns:
        boolean value
      • setUnembedFonts

        public final void setUnembedFonts(boolean value)

        Make fonts not embedded if set to true.

        Parameters:
        value - boolean value
      • getSubsetFonts

        public final boolean getSubsetFonts()

        Fonts will be converted into subsets if set to true.

        Returns:
        boolean value
      • setSubsetFonts

        public final void setSubsetFonts(boolean value)

        Fonts will be converted into subsets if set to true.

        Parameters:
        value - boolean value
      • getRemovePrivateInfo

        public final boolean getRemovePrivateInfo()

        Remove private information (page piece info).

        Returns:
        boolean value
      • setRemovePrivateInfo

        public final void setRemovePrivateInfo(boolean value)

        Remove private information (page piece info).

        Parameters:
        value - boolean value
      • getImageEncoding

        public final int getImageEncoding()

        Image encodre which will be used.

        Returns:
        ImageEncoding element
      • setImageEncoding

        public final void setImageEncoding(int value)

        Image encodre which will be used.

        Parameters:
        value - ImageEncoding element
      • all

        public 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).

        Returns:
        OptimizationOptions object.