|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pdfbox.pdmodel.graphics.xobject.PDXObject
org.pdfbox.pdmodel.graphics.xobject.PDXObjectImage
public abstract class PDXObjectImage
The prototype for all PDImages.
Field Summary | |
---|---|
static java.lang.String |
SUB_TYPE
The XObject subtype. |
Constructor Summary | |
---|---|
PDXObjectImage(PDDocument doc,
java.lang.String fileSuffix)
Standard constuctor. |
|
PDXObjectImage(PDStream imageStream,
java.lang.String fileSuffix)
Standard constuctor. |
Method Summary | |
---|---|
int |
getBitsPerComponent()
The bits per component of this image. |
PDColorSpace |
getColorSpace()
This will get the color space or null if none exists. |
int |
getHeight()
Get the height of the image. |
abstract java.awt.image.BufferedImage |
getRGBImage()
Returns an java.awt.Image, that can be used for display etc. |
java.lang.String |
getSuffix()
This will get the suffix for this image type, jpg/png. |
int |
getWidth()
Get the width of the image. |
void |
setBitsPerComponent(int bpc)
Set the number of bits per component. |
void |
setColorSpace(PDColorSpace cs)
This will set the color space for this image. |
void |
setHeight(int height)
Set the height of the image. |
void |
setWidth(int width)
Set the width of the image. |
void |
write2file(java.lang.String filename)
Writes the image to a file with the filename + an appropriate suffix, like "Image.jpg". |
abstract void |
write2OutputStream(java.io.OutputStream out)
Writes the Image to out. |
Methods inherited from class org.pdfbox.pdmodel.graphics.xobject.PDXObject |
---|
createXObject, getCOSObject, getCOSStream, getMetadata, getPDStream, setMetadata |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SUB_TYPE
Constructor Detail |
---|
public PDXObjectImage(PDStream imageStream, java.lang.String fileSuffix)
imageStream
- The XObject is passed as a COSStream.fileSuffix
- The file suffix, jpg/png.public PDXObjectImage(PDDocument doc, java.lang.String fileSuffix)
doc
- The document to store the stream in.fileSuffix
- The file suffix, jpg/png.Method Detail |
---|
public abstract java.awt.image.BufferedImage getRGBImage() throws java.io.IOException
java.io.IOException
- If there is an error creating the image.public abstract void write2OutputStream(java.io.OutputStream out) throws java.io.IOException
out
- the OutputStream that the Image is written to.
java.io.IOException
- when somethings wrong with outpublic void write2file(java.lang.String filename) throws java.io.IOException
filename
- the filename
java.io.IOException
- When somethings wrong with the corresponding file.public int getHeight()
public void setHeight(int height)
height
- The height of the image.public int getWidth()
public void setWidth(int width)
width
- The width of the image.public int getBitsPerComponent()
public void setBitsPerComponent(int bpc)
bpc
- The number of bits per component.public PDColorSpace getColorSpace() throws java.io.IOException
java.io.IOException
- If there is an error getting the colorspace.public void setColorSpace(PDColorSpace cs)
cs
- The color space for this image.public java.lang.String getSuffix()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |