Package com.independentsoft.office.pdf
Class PdfEncodedImage
java.lang.Object
com.independentsoft.office.pdf.PdfEncodedImage
An image prepared for inclusion in a PDF file. Produced by
PdfImageEncoder.-
Method Summary
Modifier and TypeMethodDescriptionbyte[]buildImageObject(int objectId, int smaskObjectId)Builds the complete image XObject.byte[]buildSoftMaskObject(int objectId)Builds the soft mask XObject holding the alpha channel.intGets the image height in pixels.intGets the image width in pixels.booleanGets whether this image has an alpha channel and needs a soft mask object.
-
Method Details
-
getPixelWidth
public int getPixelWidth()Gets the image width in pixels.- Returns:
- the width in pixels
-
getPixelHeight
public int getPixelHeight()Gets the image height in pixels.- Returns:
- the height in pixels
-
hasSoftMask
public boolean hasSoftMask()Gets whether this image has an alpha channel and needs a soft mask object.- Returns:
- true if a soft mask object must be written
-
buildImageObject
Builds the complete image XObject.- Parameters:
objectId- the PDF object id of the imagesmaskObjectId- the PDF object id of the soft mask, ignored whenhasSoftMask()is false- Returns:
- the complete "N 0 obj ... endobj" bytes
- Throws:
IOException- Signals that an I/O exception has occurred.
-
buildSoftMaskObject
Builds the soft mask XObject holding the alpha channel.- Parameters:
objectId- the PDF object id of the soft mask- Returns:
- the complete "N 0 obj ... endobj" bytes
- Throws:
IOException- Signals that an I/O exception has occurred.
-