Package com.independentsoft.office.pdf

# 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 Summary

  Modifier and Type
  Method
  Description
  `static PdfEncodedImage`
  `encode​(byte[] imageData)`
  Encodes image data for PDF embedding.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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