Class ColorSpaceConverter

java.lang.Object
com.itextpdf.pdfoptimizer.AbstractOptimizationHandler
com.itextpdf.pdfoptimizer.handlers.ColorSpaceConverter

public class ColorSpaceConverter extends AbstractOptimizationHandler
This is the class is used to convert color space of objects located in the transferred PdfDocument.
  • Constructor Details

    • ColorSpaceConverter

      public ColorSpaceConverter()
  • Method Details

    • getCsConverter

      public ICsConverter getCsConverter()
      Gets a current color space converter instance.
      Returns:
      a current ICsConverter instance
    • setCsConverter

      public ColorSpaceConverter setCsConverter (ICsConverter csConverter)
      Sets a color space converter instance.
      Parameters:
      csConverter - is a converter to set
      Returns:
      this instance
    • optimizePdf

      protected void optimizePdf (com.itextpdf.kernel.pdf.PdfDocument document, OptimizationSession session)
      The method searches across all the document and for each found PdfImageXObject performs an color converting according with defined color space converter. And performs an color converting for content streams and their resources. And removes PDF/A id schemas from PDF XMP metadata.
      Specified by:
      optimizePdf in class AbstractOptimizationHandler
      Parameters:
      document - is the PDF document to optimize. Invocation of the method can change the state of the object
      session - is an auxiliary object used to support share data between stages of optimization process