|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.pdfbox.pdmodel.edit.PDPageContentStream
This class will is a convenience for creating page content streams. You MUST call close() when you are finished with this object.
| Constructor Summary | |
PDPageContentStream(PDDocument document,
PDPage sourcePage)
Create a new PDPage content stream. |
|
PDPageContentStream(PDDocument document,
PDPage sourcePage,
boolean appendContent)
Create a new PDPage content stream. |
|
| Method Summary | |
void |
appendRawCommands(String commands)
This will append raw commands to the content stream. |
void |
beginText()
Begin some text operations. |
void |
close()
Close the content stream. |
void |
drawImage(PDXObjectImage image,
int x,
int y)
Draw an image at the x,y coordinates, with the default size of the image. |
void |
drawImage(PDXObjectImage image,
int x,
int y,
int width,
int height)
Draw an image at the x,y coordinates and a certain width and height. |
void |
drawString(String text)
This will draw a string at the current location on the screen. |
void |
endText()
End some text operations. |
void |
fillRect(float x,
float y,
float width,
float height)
Draw a rectangle on the page using the current non stroking color. |
void |
moveTextPositionByAmount(float x,
float y)
The Td operator. |
void |
setFont(PDFont font,
float fontSize)
Set the font to draw text with. |
void |
setNonStrokingColor(Color color)
Set the non stroking color, specified as RGB. |
void |
setNonStrokingColor(int r,
int g,
int b)
Set the non stroking color, specified as RGB, 0-255. |
void |
setStrokingColor(Color color)
Set the stroking color, specified as RGB. |
void |
setStrokingColor(int r,
int g,
int b)
Set the stroking color, specified as RGB, 0-255. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PDPageContentStream(PDDocument document,
PDPage sourcePage)
throws IOException
document - The document the page is part of.sourcePage - The page to write the contents to.
IOException - If there is an error writing to the page contents.
public PDPageContentStream(PDDocument document,
PDPage sourcePage,
boolean appendContent)
throws IOException
document - The document the page is part of.sourcePage - The page to write the contents to.appendContent - Indicates whter content will be overwritten. If false all previous content is deleted
IOException - If there is an error writing to the page contents.| Method Detail |
public void beginText()
throws IOException
IOException - If there is an error writing to the stream or if you attempt to
nest beginText calls.
public void endText()
throws IOException
IOException - If there is an error writing to the stream or if you attempt to
nest endText calls.
public void setFont(PDFont font,
float fontSize)
throws IOException
font - The font to use.fontSize - The font size to draw the text.
IOException - If there is an error writing the font information.
public void drawImage(PDXObjectImage image,
int x,
int y)
throws IOException
image - The image to draw.x - The x-coordinate to draw the image.y - The y-coordinate to draw the image.
IOException - If there is an error writing to the stream.
public void drawImage(PDXObjectImage image,
int x,
int y,
int width,
int height)
throws IOException
image - The image to draw.x - The x-coordinate to draw the image.y - The y-coordinate to draw the image.width - The width of the image to draw.height - The height of the image to draw.
IOException - If there is an error writing to the stream.
public void moveTextPositionByAmount(float x,
float y)
throws IOException
x - The x coordinate.y - The y coordinate.
IOException - If there is an error writing to the stream.
public void drawString(String text)
throws IOException
text - The text to draw.
IOException - If an io exception occurs.
public void setStrokingColor(Color color)
throws IOException
color - The color to set.
IOException - If an IO error occurs while writing to the stream.
public void setNonStrokingColor(Color color)
throws IOException
color - The color to set.
IOException - If an IO error occurs while writing to the stream.
public void setStrokingColor(int r,
int g,
int b)
throws IOException
r - The red value.g - The green value.b - The blue value.
IOException - If an IO error occurs while writing to the stream.
public void setNonStrokingColor(int r,
int g,
int b)
throws IOException
r - The red value.g - The green value.b - The blue value.
IOException - If an IO error occurs while writing to the stream.
public void fillRect(float x,
float y,
float width,
float height)
throws IOException
x - The lower left x coordinate.y - The lower left y coordinate.width - The width of the rectangle.height - The height of the rectangle.
IOException - If there is an error while drawing on the screen.
public void appendRawCommands(String commands)
throws IOException
commands - The commands to append to the stream.
IOException - If an error occurs while writing to the stream.
public void close()
throws IOException
IOException - If the underlying stream has a problem being written to.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||