com.aspose.pdf

Interfaces

Classes

Enums

Exceptions

com.aspose.pdf

Class Document.OptimizationOptions

  • Enclosing class:
    Document


    public static class Document.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 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 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 boolean getAllowReusePageContent()

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

        Returns:
        boolean value
      • setAllowReusePageContent

        public void setAllowReusePageContent(boolean value)

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

        Parameters:
        value - boolean value
      • getRemoveUnusedStreams

        public 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 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 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 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
      • isCompressImages

        public boolean isCompressImages()

        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

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

        Parameters:
        value - boolean value
      • isResizeImages

        public boolean isResizeImages()

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

        Returns:
        boolean value
      • setResizeImages

        public void setResizeImages(boolean value)

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

        Parameters:
        value - boolean value
      • getImageQuality

        public int getImageQuality()

        Specifie slevel of image compression when CompressIamges flag is used.

        Returns:
        image quality
      • setImageQuality

        public void setImageQuality(int value)

        Specifies level of image compression when CompressIamges flag is used.

        Parameters:
        value - image quality
      • getMaxResoultion

        public int getMaxResoultion()

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

        Returns:
        int value
      • setMaxResoultion

        public void setMaxResoultion(int value)

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

        Parameters:
        value - int value
      • isUnembedFonts

        public boolean isUnembedFonts()

        Make fonts not embedded if set to true.

        Returns:
        boolean value
      • setUnembedFonts

        public void setUnembedFonts(boolean value)

        Make fonts not embedded if set to true.

        Parameters:
        value - boolean value
      • isRemovePrivateInfo

        public boolean isRemovePrivateInfo()

        Remove private information (page piece info).

        Returns:
        boolean value
      • setRemovePrivateInfo

        public void setRemovePrivateInfo(boolean value)

        Remove private information (page piece info).

        Parameters:
        value - boolean value
      • all

        public static Document.OptimizationOptions all()

        Creates optimization strategy will all options activated.

        Returns:
        OptimizationOptions object.
      • getResolution

        public int getResolution()

        Specifies new image dpi when CompressIamges flag is used.

        Returns:
        image resolution
      • setResolution

        public void setResolution(int dpi)

        Specifies new image dpi when CompressIamges flag is used.

        Parameters:
        dpi - image resolution
      • getMaximumImageDimension

        public int getMaximumImageDimension()

        Specifies maximum image dimension. If the image width or height of the existing image is greater than this value - the image size will be proportionally reduced.

        Returns:
        image maximum dimension
      • setMaximumImageDimension

        public void setMaximumImageDimension(int dimension)

        Specifies maximum image dimension. If the image width or height of the existing image is greater than this value - the image size will be proportionally reduced.

        Parameters:
        dimension - image maximum dimension