This class will is a convenience for creating page content streams. You MUST
call close() when you are finished with this object.
appendRawCommands
public void appendRawCommands(String commands)
throws IOException
This will append raw commands to the content stream.
commands
- The commands to append to the stream.
appendRawCommands
public void appendRawCommands(byte[] commands)
throws IOException
This will append raw commands to the content stream.
commands
- The commands to append to the stream.
appendRawCommands
public void appendRawCommands(int data)
throws IOException
This will append raw commands to the content stream.
data
- Append a raw byte to the stream.
beginText
public void beginText()
throws IOException
Begin some text operations.
close
public void close()
throws IOException
Close the content stream. This must be called when you are done with this
object.
drawImage
public void drawImage(PDXObjectImage image,
float x,
float y)
throws IOException
Draw an image at the x,y coordinates, with the default size of the image.
image
- The image to draw.x
- The x-coordinate to draw the image.y
- The y-coordinate to draw the image.
drawImage
public void drawImage(PDXObjectImage image,
float x,
float y,
float width,
float height)
throws IOException
Draw an image at the x,y coordinates and a certain width and height.
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.
drawString
public void drawString(String text)
throws IOException
This will draw a string at the current location on the screen.
endText
public void endText()
throws IOException
End some text operations.
fillRect
public void fillRect(float x,
float y,
float width,
float height)
throws IOException
Draw a rectangle on the page using the current non stroking color.
x
- The lower left x coordinate.y
- The lower left y coordinate.width
- The width of the rectangle.height
- The height of the rectangle.
moveTextPositionByAmount
public void moveTextPositionByAmount(float x,
float y)
throws IOException
The Td operator.
x
- The x coordinate.y
- The y coordinate.
setFont
public void setFont(PDFont font,
float fontSize)
throws IOException
Set the font to draw text with.
font
- The font to use.fontSize
- The font size to draw the text.
setNonStrokingColor
public void setNonStrokingColor(Color color)
throws IOException
Set the non stroking color, specified as RGB.
color
- The color to set.
setNonStrokingColor
public void setNonStrokingColor(double g)
throws IOException
Set the non stroking color, specified as Grayscale 0.0-1.0.
setNonStrokingColor
public void setNonStrokingColor(double c,
double m,
double y,
double k)
throws IOException
Set the non stroking color, specified as CMYK, 0.0-1.0.
c
- The cyan value.m
- The magenta value.y
- The yellow value.k
- The black value.
setNonStrokingColor
public void setNonStrokingColor(float[] components)
throws IOException
Set the color components of current non stroking colorspace.
components
- The components to set for the current color.
setNonStrokingColor
public void setNonStrokingColor(int g)
throws IOException
Set the non stroking color, specified as grayscale, 0-255.
setNonStrokingColor
public void setNonStrokingColor(int r,
int g,
int b)
throws IOException
Set the non stroking color, specified as RGB, 0-255.
r
- The red value.g
- The green value.b
- The blue value.
setNonStrokingColor
public void setNonStrokingColor(int c,
int m,
int y,
int k)
throws IOException
Set the non stroking color, specified as CMYK, 0-255.
c
- The cyan value.m
- The magenta value.y
- The yellow value.k
- The black value.
setNonStrokingColorSpace
public void setNonStrokingColorSpace(PDColorSpace colorSpace)
throws IOException
Set the stroking color space. This will add the colorspace to the PDResources
if necessary.
colorSpace
- The colorspace to write.
setStrokingColor
public void setStrokingColor(Color color)
throws IOException
Set the stroking color, specified as RGB.
color
- The color to set.
setStrokingColor
public void setStrokingColor(double g)
throws IOException
Set the stroking color, specified as Grayscale 0.0-1.0.
setStrokingColor
public void setStrokingColor(double c,
double m,
double y,
double k)
throws IOException
Set the stroking color, specified as CMYK, 0.0-1.0.
c
- The cyan value.m
- The magenta value.y
- The yellow value.k
- The black value.
setStrokingColor
public void setStrokingColor(float[] components)
throws IOException
Set the color components of current stroking colorspace.
components
- The components to set for the current color.
setStrokingColor
public void setStrokingColor(int g)
throws IOException
Set the stroking color, specified as grayscale, 0-255.
setStrokingColor
public void setStrokingColor(int r,
int g,
int b)
throws IOException
Set the stroking color, specified as RGB, 0-255.
r
- The red value.g
- The green value.b
- The blue value.
setStrokingColor
public void setStrokingColor(int c,
int m,
int y,
int k)
throws IOException
Set the stroking color, specified as CMYK, 0-255.
c
- The cyan value.m
- The magenta value.y
- The yellow value.k
- The black value.
setStrokingColorSpace
public void setStrokingColorSpace(PDColorSpace colorSpace)
throws IOException
Set the stroking color space. This will add the colorspace to the PDResources
if necessary.
colorSpace
- The colorspace to write.