| java.lang.Object org.pdfbox.pdmodel.edit.PDPageContentStream
PDPageContentStream | public class PDPageContentStream (Code) | | This class will is a convenience for creating page content streams. You MUST
call close() when you are finished with this object.
author: Ben Litchfield version: $Revision: 1.18 $ |
Constructor Summary | |
public | PDPageContentStream(PDDocument document, PDPage sourcePage) Create a new PDPage content stream. | public | PDPageContentStream(PDDocument document, PDPage sourcePage, boolean appendContent, boolean compress) Create a new PDPage content stream.
Parameters: document - The document the page is part of. Parameters: sourcePage - The page to write the contents to. Parameters: appendContent - Indicates whether content will be overwritten. |
Method Summary | |
public void | appendRawCommands(String commands) This will append raw commands to the content stream. | public void | appendRawCommands(byte[] commands) This will append raw commands to the content stream. | public void | appendRawCommands(int data) This will append raw commands to the content stream. | public void | beginText() Begin some text operations. | public void | close() Close the content stream. | public void | drawImage(PDXObjectImage image, float x, float y) Draw an image at the x,y coordinates, with the default size of the image. | public void | drawImage(PDXObjectImage image, float x, float y, float width, float height) Draw an image at the x,y coordinates and a certain width and height. | public void | drawString(String text) This will draw a string at the current location on the screen. | public void | endText() End some text operations. | public void | fillRect(float x, float y, float width, float height) Draw a rectangle on the page using the current non stroking color. | public void | moveTextPositionByAmount(float x, float y) The Td operator. | public void | setFont(PDFont font, float fontSize) Set the font to draw text with. | public void | setNonStrokingColor(Color color) Set the non stroking color, specified as RGB. | public void | setNonStrokingColor(float[] components) Set the color components of current non stroking colorspace. | public void | setNonStrokingColor(int r, int g, int b) Set the non stroking color, specified as RGB, 0-255. | public void | setNonStrokingColor(int c, int m, int y, int k) Set the non stroking color, specified as CMYK, 0-255. | public void | setNonStrokingColor(double c, double m, double y, double k) Set the non stroking color, specified as CMYK, 0.0-1.0. | public void | setNonStrokingColor(int g) Set the non stroking color, specified as grayscale, 0-255. | public void | setNonStrokingColor(double g) Set the non stroking color, specified as Grayscale 0.0-1.0. | public void | setNonStrokingColorSpace(PDColorSpace colorSpace) Set the stroking color space. | public void | setStrokingColor(float[] components) Set the color components of current stroking colorspace. | public void | setStrokingColor(Color color) Set the stroking color, specified as RGB. | public void | setStrokingColor(int r, int g, int b) Set the stroking color, specified as RGB, 0-255. | public void | setStrokingColor(int c, int m, int y, int k) Set the stroking color, specified as CMYK, 0-255. | public void | setStrokingColor(double c, double m, double y, double k) Set the stroking color, specified as CMYK, 0.0-1.0. | public void | setStrokingColor(int g) Set the stroking color, specified as grayscale, 0-255. | public void | setStrokingColor(double g) Set the stroking color, specified as Grayscale 0.0-1.0. | public void | setStrokingColorSpace(PDColorSpace colorSpace) Set the stroking color space. |
PDPageContentStream | public PDPageContentStream(PDDocument document, PDPage sourcePage) throws IOException(Code) | | Create a new PDPage content stream.
Parameters: document - The document the page is part of. Parameters: sourcePage - The page to write the contents to. throws: IOException - If there is an error writing to the page contents. |
PDPageContentStream | public PDPageContentStream(PDDocument document, PDPage sourcePage, boolean appendContent, boolean compress) throws IOException(Code) | | Create a new PDPage content stream.
Parameters: document - The document the page is part of. Parameters: sourcePage - The page to write the contents to. Parameters: appendContent - Indicates whether content will be overwritten. If false all previous content is deleted. Parameters: compress - Tell if the content stream should compress the page contents. throws: IOException - If there is an error writing to the page contents. |
appendRawCommands | public void appendRawCommands(String commands) throws IOException(Code) | | This will append raw commands to the content stream.
Parameters: commands - The commands to append to the stream. throws: IOException - If an error occurs while writing to the stream. |
appendRawCommands | public void appendRawCommands(byte[] commands) throws IOException(Code) | | This will append raw commands to the content stream.
Parameters: commands - The commands to append to the stream. throws: IOException - If an error occurs while writing to the stream. |
appendRawCommands | public void appendRawCommands(int data) throws IOException(Code) | | This will append raw commands to the content stream.
Parameters: data - Append a raw byte to the stream. throws: IOException - If an error occurs while writing to the stream. |
beginText | public void beginText() throws IOException(Code) | | Begin some text operations.
throws: IOException - If there is an error writing to the stream or if you attempt to nest beginText calls. |
close | public void close() throws IOException(Code) | | Close the content stream. This must be called when you are done with this
object.
throws: IOException - If the underlying stream has a problem being written to. |
drawImage | public void drawImage(PDXObjectImage image, float x, float y) throws IOException(Code) | | Draw an image at the x,y coordinates, with the default size of the image.
Parameters: image - The image to draw. Parameters: x - The x-coordinate to draw the image. Parameters: y - The y-coordinate to draw the image. throws: IOException - If there is an error writing to the stream. |
drawImage | public void drawImage(PDXObjectImage image, float x, float y, float width, float height) throws IOException(Code) | | Draw an image at the x,y coordinates and a certain width and height.
Parameters: image - The image to draw. Parameters: x - The x-coordinate to draw the image. Parameters: y - The y-coordinate to draw the image. Parameters: width - The width of the image to draw. Parameters: height - The height of the image to draw. throws: IOException - If there is an error writing to the stream. |
drawString | public void drawString(String text) throws IOException(Code) | | This will draw a string at the current location on the screen.
Parameters: text - The text to draw. throws: IOException - If an io exception occurs. |
endText | public void endText() throws IOException(Code) | | End some text operations.
throws: IOException - If there is an error writing to the stream or if you attempt to nest endText calls. |
fillRect | public void fillRect(float x, float y, float width, float height) throws IOException(Code) | | Draw a rectangle on the page using the current non stroking color.
Parameters: x - The lower left x coordinate. Parameters: y - The lower left y coordinate. Parameters: width - The width of the rectangle. Parameters: height - The height of the rectangle. throws: IOException - If there is an error while drawing on the screen. |
moveTextPositionByAmount | public void moveTextPositionByAmount(float x, float y) throws IOException(Code) | | The Td operator.
Parameters: x - The x coordinate. Parameters: y - The y coordinate. throws: IOException - If there is an error writing to the stream. |
setFont | public void setFont(PDFont font, float fontSize) throws IOException(Code) | | Set the font to draw text with.
Parameters: font - The font to use. Parameters: fontSize - The font size to draw the text. throws: IOException - If there is an error writing the font information. |
setNonStrokingColor | public void setNonStrokingColor(Color color) throws IOException(Code) | | Set the non stroking color, specified as RGB.
Parameters: color - The color to set. throws: IOException - If an IO error occurs while writing to the stream. |
setNonStrokingColor | public void setNonStrokingColor(float[] components) throws IOException(Code) | | Set the color components of current non stroking colorspace.
Parameters: components - The components to set for the current color. throws: IOException - If there is an error while writing to the stream. |
setNonStrokingColor | public void setNonStrokingColor(int r, int g, int b) throws IOException(Code) | | Set the non stroking color, specified as RGB, 0-255.
Parameters: r - The red value. Parameters: g - The green value. Parameters: b - The blue value. throws: IOException - If an IO error occurs while writing to the stream. |
setNonStrokingColor | public void setNonStrokingColor(int c, int m, int y, int k) throws IOException(Code) | | Set the non stroking color, specified as CMYK, 0-255.
Parameters: c - The cyan value. Parameters: m - The magenta value. Parameters: y - The yellow value. Parameters: k - The black value. throws: IOException - If an IO error occurs while writing to the stream. |
setNonStrokingColor | public void setNonStrokingColor(double c, double m, double y, double k) throws IOException(Code) | | Set the non stroking color, specified as CMYK, 0.0-1.0.
Parameters: c - The cyan value. Parameters: m - The magenta value. Parameters: y - The yellow value. Parameters: k - The black value. throws: IOException - If an IO error occurs while writing to the stream. |
setNonStrokingColor | public void setNonStrokingColor(int g) throws IOException(Code) | | Set the non stroking color, specified as grayscale, 0-255.
Parameters: g - The gray value. throws: IOException - If an IO error occurs while writing to the stream. |
setNonStrokingColor | public void setNonStrokingColor(double g) throws IOException(Code) | | Set the non stroking color, specified as Grayscale 0.0-1.0.
Parameters: g - The gray value. throws: IOException - If an IO error occurs while writing to the stream. |
setNonStrokingColorSpace | public void setNonStrokingColorSpace(PDColorSpace colorSpace) throws IOException(Code) | | Set the stroking color space. This will add the colorspace to the PDResources
if necessary.
Parameters: colorSpace - The colorspace to write. throws: IOException - If there is an error writing the colorspace. |
setStrokingColor | public void setStrokingColor(float[] components) throws IOException(Code) | | Set the color components of current stroking colorspace.
Parameters: components - The components to set for the current color. throws: IOException - If there is an error while writing to the stream. |
setStrokingColor | public void setStrokingColor(Color color) throws IOException(Code) | | Set the stroking color, specified as RGB.
Parameters: color - The color to set. throws: IOException - If an IO error occurs while writing to the stream. |
setStrokingColor | public void setStrokingColor(int r, int g, int b) throws IOException(Code) | | Set the stroking color, specified as RGB, 0-255.
Parameters: r - The red value. Parameters: g - The green value. Parameters: b - The blue value. throws: IOException - If an IO error occurs while writing to the stream. |
setStrokingColor | public void setStrokingColor(int c, int m, int y, int k) throws IOException(Code) | | Set the stroking color, specified as CMYK, 0-255.
Parameters: c - The cyan value. Parameters: m - The magenta value. Parameters: y - The yellow value. Parameters: k - The black value. throws: IOException - If an IO error occurs while writing to the stream. |
setStrokingColor | public void setStrokingColor(double c, double m, double y, double k) throws IOException(Code) | | Set the stroking color, specified as CMYK, 0.0-1.0.
Parameters: c - The cyan value. Parameters: m - The magenta value. Parameters: y - The yellow value. Parameters: k - The black value. throws: IOException - If an IO error occurs while writing to the stream. |
setStrokingColor | public void setStrokingColor(int g) throws IOException(Code) | | Set the stroking color, specified as grayscale, 0-255.
Parameters: g - The gray value. throws: IOException - If an IO error occurs while writing to the stream. |
setStrokingColor | public void setStrokingColor(double g) throws IOException(Code) | | Set the stroking color, specified as Grayscale 0.0-1.0.
Parameters: g - The gray value. throws: IOException - If an IO error occurs while writing to the stream. |
setStrokingColorSpace | public void setStrokingColorSpace(PDColorSpace colorSpace) throws IOException(Code) | | Set the stroking color space. This will add the colorspace to the PDResources
if necessary.
Parameters: colorSpace - The colorspace to write. throws: IOException - If there is an error writing the colorspace. |
|
|