Class PDFOptimizer

java.lang.Object
com.datalogics.PDFL.PDFOptimizer

public class PDFOptimizer extends Object
Implementation of the PDF Optimizer function. Use the PDFOptimizer object to accumulate options for the Optimization, and to Optimize documents.
  • Constructor Details

    • PDFOptimizer

      public PDFOptimizer()
      Construct a CPDFOptimizer, with default Options.
  • Method Details

    • delete

      public void delete()
    • optimize

      public void optimize(Document doc, ImageOutputStream stream) throws IOException
      Throws:
      IOException
    • optimize

      public void optimize(Document doc, ImageOutputStream stream, ProgressMonitor progressMonitor, CancelProc cancelProc) throws IOException
      Throws:
      IOException
    • getOption

      public boolean getOption(OptimizerOption option)
      Get the value of a single Optimizer Option.
    • setOption

      public void setOption(OptimizerOption option, boolean value)
      Set the value of a single Optimizer option.
    • getMaxResolution

      public int getMaxResolution(CompressImageType type)
      Get the value of the Max DPI for a given color model.
    • setMaxResolution

      public void setMaxResolution(CompressImageType type, int value)
      Set the value for the Max DPI for a given color model. Any image above this resolution will be down sampled, if the Downsampling option is true for this color model.
    • getResampleToResolution

      public int getResampleToResolution(CompressImageType type)
      Get the value of the Resample To DPI for a given color model.
    • setResampleToResolution

      public void setResampleToResolution(CompressImageType type, int value)
      Set the value for the Resample To DPI for a given color model. Any image will be downsampled to this resolution, if the Downsampling option is true for this color model.
    • getRecompressionType

      public CompressionType getRecompressionType(CompressImageType type)
      Get the value of the Recompression Type for a given color model.
    • setRecompressionType

      public void setRecompressionType(CompressImageType type, CompressionType value)
      Set the value for the recompression Type for a given color model. Any image that is downsampled will be compressed using this method, if the Downsampling option is true for this color model. Any image that is not downsampled, will be converted to this compression type, if it is not already compressed in this type, and the Recompression option for this color model is true.
    • getCompressionQuality

      public CompressQuality getCompressionQuality(CompressImageType type)
      Get the value of the Compression Quality for a given color model.
    • setCompressionQuality

      public void setCompressionQuality(CompressImageType type, CompressQuality value)
      Set the value for the Compression Quality for a given color model. Any image that recompressed, regardless of the reason, will use this Quality for the Quality value of the specific compression type.
    • getMajorVersion

      public short getMajorVersion()
      Get the value of the Major Version of the optimized document.

      NOTE: A value of 0 indicates the Optimizer will decide what version it should be.

    • setMajorVersion

      public void setMajorVersion(short major)
      Set the value for the Major Version for the optimized document.
    • getMinorVersion

      public short getMinorVersion()
      Get the value of the Minor Version of the optimized document.
    • setMinorVersion

      public void setMinorVersion(short minor)
      Set the value for the Minor Version for the optimized document.
    • getObjectCompression

      public ObjectCompressionType getObjectCompression()
      Get the value of the Object Compression of the optimized document.
    • setObjectCompression

      public void setObjectCompression(ObjectCompressionType objectCompression)
      Set the value for the Object Compression for the optimized document.
    • optimize

      public void optimize(Document document, String newPath, ProgressMonitor progressMonitor, CancelProc cancelProc)
      Perform the Optimization of a single document, saving the result in a new file.
    • optimize

      public void optimize(Document document, String newPath)
    • optimize

      public void optimize(Document document, com.datalogics.PDFL.JavaStreamFile dest, ProgressMonitor progressMonitor, CancelProc cancelProc)
      Perform the Optimization of a single document, saving the result in memory.
    • optimize

      public void optimize(Document document, com.datalogics.PDFL.JavaStreamFile dest)