Class PdfImageEncoder

java.lang.Object
com.independentsoft.office.pdf.PdfImageEncoder

public class PdfImageEncoder extends Object
Prepares raster images for inclusion in PDF files. JPEG images are passed through with the DCTDecode filter (including grayscale and Adobe CMYK detection); all other formats are decoded with ImageIO and stored with the FlateDecode filter, preserving an alpha channel as a soft mask.
  • Method Details

    • encode

      public static PdfEncodedImage encode(byte[] imageData)
      Encodes image data for PDF embedding.
      Parameters:
      imageData - the raw image file bytes
      Returns:
      the encoded image or null when the format is not supported