public final class PDAppearanceContentStream extends PDAbstractContentStream implements java.io.Closeable
document, fontStack, inTextMode, nonStrokingColorSpaceStack, outputStream, resources, strokingColorSpaceStack
Constructor and Description |
---|
PDAppearanceContentStream(PDAppearanceStream appearance)
Create a new appearance stream.
|
PDAppearanceContentStream(PDAppearanceStream appearance,
boolean compress)
Create a new appearance stream.
|
PDAppearanceContentStream(PDAppearanceStream appearance,
java.io.OutputStream outputStream)
Create a new appearance stream.
|
Modifier and Type | Method and Description |
---|---|
void |
drawShape(float lineWidth,
boolean hasStroke,
boolean hasFill)
Draw a shape.
|
void |
setBorderLine(float lineWidth,
PDBorderStyleDictionary bs,
COSArray border)
Convenience method for annotations: sets the line with and dash style.
|
void |
setLineWidthOnDemand(float lineWidth)
Sets the line width.
|
void |
setNonStrokingColor(float[] components)
Set the non stroking color.
|
boolean |
setNonStrokingColorOnDemand(PDColor color)
Set the non stroking color.
|
void |
setStrokingColor(float[] components)
Set the stroking color.
|
boolean |
setStrokingColorOnDemand(PDColor color)
Set the stroking color.
|
addComment, addRect, beginMarkedContent, beginMarkedContent, beginText, clip, clipEvenOdd, close, closeAndFillAndStroke, closeAndFillAndStrokeEvenOdd, closeAndStroke, closePath, curveTo, curveTo1, curveTo2, drawForm, drawImage, drawImage, drawImage, drawImage, drawImage, endMarkedContent, endText, fill, fillAndStroke, fillAndStrokeEvenOdd, fillEvenOdd, getName, isOutside255Interval, lineTo, moveTo, newLine, newLineAtOffset, restoreGraphicsState, saveGraphicsState, setCharacterSpacing, setFont, setGraphicsStateParameters, setHorizontalScaling, setLeading, setLineCapStyle, setLineDashPattern, setLineJoinStyle, setLineWidth, setMaximumFractionDigits, setMiterLimit, setNonStrokingColor, setNonStrokingColor, setNonStrokingColor, setNonStrokingColor, setNonStrokingColor, setNonStrokingColor, setNonStrokingColor, setNonStrokingColor, setNonStrokingColorSpaceStack, setRenderingMode, setStrokingColor, setStrokingColor, setStrokingColor, setStrokingColor, setStrokingColor, setStrokingColor, setStrokingColorSpaceStack, setTextMatrix, setTextRise, setWordSpacing, shadingFill, showText, showTextInternal, showTextWithPositioning, stroke, transform, write, write, writeBytes, writeLine, writeOperand, writeOperand, writeOperand, writeOperator
public PDAppearanceContentStream(PDAppearanceStream appearance) throws java.io.IOException
appearance
- The appearance stream to write to.java.io.IOException
- If there is an error writing to the content stream.public PDAppearanceContentStream(PDAppearanceStream appearance, boolean compress) throws java.io.IOException
appearance
- The appearance stream to write to.compress
- whether the content stream is to be compressed. Set this to true when
creating long content streams.java.io.IOException
- If there is an error writing to the content stream.public PDAppearanceContentStream(PDAppearanceStream appearance, java.io.OutputStream outputStream)
appearance
- The appearance stream to add to.outputStream
- The appearances output stream to write to.public boolean setStrokingColorOnDemand(PDColor color) throws java.io.IOException
The command is only emitted if the color is not null and the number of components is > 0.
color
- The colorspace to write.java.io.IOException
- If there is an error writing to the content stream.PDAbstractContentStream.setStrokingColor(PDColor)
public void setStrokingColor(float[] components) throws java.io.IOException
components
- the color components dependent on the color space being used.java.io.IOException
- If there is an error writing to the content stream.PDAbstractContentStream.setStrokingColor(java.awt.Color)
public boolean setNonStrokingColorOnDemand(PDColor color) throws java.io.IOException
The command is only emitted if the color is not null and the number of components is > 0.
color
- The colorspace to write.java.io.IOException
- If there is an error writing to the content stream.PDAbstractContentStream.setNonStrokingColor(PDColor)
public void setNonStrokingColor(float[] components) throws java.io.IOException
components
- the color components dependent on the color space being used.java.io.IOException
- If there is an error writing to the content stream.PDAbstractContentStream.setNonStrokingColor(java.awt.Color)
public void setBorderLine(float lineWidth, PDBorderStyleDictionary bs, COSArray border) throws java.io.IOException
lineWidth
- The line width.bs
- The border style, may be null.border
- The border array, must have at least three entries. This is
only used if the border style is null.java.io.IOException
- If there is an error writing to the content stream.public void setLineWidthOnDemand(float lineWidth) throws java.io.IOException
lineWidth
- the line width of the path.java.io.IOException
- If there is an error writing to the content stream.PDAbstractContentStream.setLineWidth(float)
public void drawShape(float lineWidth, boolean hasStroke, boolean hasFill) throws java.io.IOException
Dependent on the lineWidth and whether or not there is a background to be generated there are different commands to be used for draw a shape.
lineWidth
- the line width of the path.hasStroke
- shall there be a stroking color.hasFill
- shall there be a fill color.java.io.IOException
- If there is an error writing to the content stream.