| de.intarsys.pdf.content.CSVirtualDevice de.intarsys.pdf.content.common.CSCreator
CSCreator | public class CSCreator extends CSVirtualDevice (Code) | | An implementation helping to create a PDF content stream using higher level
abstractions than the PDF operators.
This object deals with two abstractions:
The
CSContent , a sequence of PDF operators. The
CSContent can be read from an existing object like a
PDPage or a
PDForm or can be newly created, suing the factory methods in
CSContent .
The second abstraction is the
IResourcesProvider for the
PDResources like Fonts, XObjects, ... that are referenced in the
CSContent . The resources of the provider are not accessed until a
resource relevant operation is created.
This implementation is (nearly, see AffineTransform) independent of AWT or
any other window toolkit.
|
Method Summary | |
protected void | basicTextShow(byte[] text) | protected COSName | checkResource(COSName resourceType, PDObject.MetaClass metaClass, COSName resourceName, PDObject resource) | public void | close() | public void | compatibilityBegin() | public void | compatibilityEnd() | public void | copy(CSContent otherContent) Copy all operations from otherContent to this . | public static CSCreator | createFromContent(CSContent content, IResourcesProvider resourcesProvider) Create a
CSCreator on an existing
CSContent . | public static CSCreator | createFromProvider(IContentStreamProvider provider) Create a
CSCreator on an existing
CSContent that will be
read from the
IContentStreamProvider . | public static CSCreator | createNew(IContentStreamProvider provider) Create a
CSCreator on a newly created
CSContent . | public static CSCreator | createNewDetached(IResourcesProvider provider) Create a
CSCreator on a newly created
CSContent . | public void | doShading(COSName name, PDShading shading) | public void | doXObject(COSName name, PDXObject xObject) | public void | flush() Flush all pending operations on the stream. | public CSContent | getContent() The
CSContent we are working on. | public IContentStreamProvider | getContentStreamProvider() | protected PDResources | getResources() | public IResourcesProvider | getResourcesProvider() The
IResourcesProvider associated with this. | protected List | getStrings() | protected ByteArrayOutputStream | getTextBuffer() | public void | inlineImage(PDImage img) | protected boolean | isFont(PDFont queryFont, float queryFontSize) Answer true if the actual font in the text state is equal
to queryFont and queryFontSize .
Parameters: queryFont - The font to query. Parameters: queryFontSize - The font size to query. | protected boolean | isNonStrokeCMYKColor(float c, float m, float y, float k) | protected boolean | isNonStrokeRGBColor(float r, float g, float b) | protected boolean | isStrokeCMYKColor(float c, float m, float y, float k) | protected boolean | isStrokeRGBColor(float r, float g, float b) | protected boolean | isTextMode() | public void | markedContentBegin(COSName tag) | public void | markedContentBeginProperties(COSName tag, COSName resourceName, COSDictionary properties) | public void | markedContentEnd() | public void | markedContentPoint(COSName tag) | public void | markedContentPointProperties(COSName tag, COSName resourceName, COSDictionary properties) | public void | open(ICSInterpreter pInterpreter) | protected void | operationAdd(CSOperation operation) | public void | pathClipEvenOdd() | public void | pathClipNonZero() | public void | pathClose() | public void | pathCloseFillStrokeEvenOdd() | public void | pathCloseFillStrokeNonZero() | public void | pathCloseStroke() | public void | pathEnd() | public void | pathFillEvenOdd() | public void | pathFillNonZero() | public void | pathFillStrokeEvenOdd() | public void | pathFillStrokeNonZero() | public void | pathStroke() | public void | penCircle(float x, float y, float r) Draw a circle. | public void | penCurveToC(float x1, float y1, float x2, float y2, float x3, float y3) | public void | penCurveToV(float x2, float y2, float x3, float y3) | public void | penCurveToY(float x1, float y1, float x3, float y3) | public void | penEllipse(float x, float y, float rx, float ry) Draw an ellipse. | public void | penLineTo(float x, float y) | public void | penMoveTo(float x, float y) | public void | penRectangle(float x, float y, float w, float h) | protected void | resetStrings() | protected void | resetTextBuffer() | public void | restoreState() | public void | saveState() | public void | setExtendedState(COSName name, PDExtGState gstate) | public void | setFlatnessTolerance(float flatness) | public void | setLineCap(int style) | public void | setLineDash(float unitsOn, float unitsOff, float phase) Convenience method to access "setLineDash". | public void | setLineDash(float[] pattern, float phase) | public void | setLineJoin(int style) | public void | setLineWidth(float w) | public void | setMiterLimit(float miterLimit) | public void | setNonStrokeColorCMYK(float c, float m, float y, float k) | public void | setNonStrokeColorGray(float gray) | public void | setNonStrokeColorRGB(float red, float green, float blue) | public void | setNonStrokeColorSpace(COSName name, PDColorSpace colorSpace) | public void | setNonStrokeColorValues(float[] values) | public void | setNonStrokeColorValues(float[] values, COSName name, PDPattern pattern) | public void | setRenderingIntent(COSName intent) | public void | setStrokeColorCMYK(float cyan, float magenta, float yellow, float key) | public void | setStrokeColorGray(float gray) | public void | setStrokeColorRGB(float red, float green, float blue) | public void | setStrokeColorSpace(COSName name, PDColorSpace colorSpace) | public void | setStrokeColorValues(float[] values) | public void | setStrokeColorValues(float[] values, COSName name, PDPattern pattern) | protected void | setTextMode(boolean b) | protected void | streamEnd() Close a currently open line. | protected void | streamEndRun() Close a currently open optimzed character sequence. | protected void | streamEndShow(COSArray theStrings) | public void | textBegin() | public void | textEnd() | public void | textLineMove(float dx, float dy) | public void | textLineMoveSetLeading(float dx, float dy) Move the current text line by dx , dy . | public void | textLineMoveTo(float x, float y) Move the current text line to absolute position x ,
y . | public void | textLineNew() | public void | textMove(float dx, float dy) | public void | textMoveTo(float x, float y) | public void | textSetCharSpacing(float charSpace) | public void | textSetFont(COSName name, PDFont font, float size) | public void | textSetHorizontalScaling(float scale) | public void | textSetLeading(float leading) | public void | textSetRenderingMode(int rendering) | public void | textSetRise(float rise) | public void | textSetTransform(float a, float b, float c, float d, float e, float f) | public void | textSetWordSpacing(float wordSpace) | public void | textShow(byte[] text, int offset, int length) | public void | textT3SetGlyphWidth(float x, float y) | public void | textT3SetGlyphWidthBB(float x, float y, float llx, float lly, float urx, float ury) | public void | transform(float a, float b, float c, float d, float e, float f) |
KAPPA | final public static float KAPPA(Code) | | a constant for the ease of circle creation with beziers
|
VALUE_COLOR_PRECISION | final public static int VALUE_COLOR_PRECISION(Code) | | |
VALUE_COORDINATE_PRECISION | final public static int VALUE_COORDINATE_PRECISION(Code) | | |
VALUE_DASH_PRECISION | final public static int VALUE_DASH_PRECISION(Code) | | |
VALUE_FACTOR_PRECISION | final public static int VALUE_FACTOR_PRECISION(Code) | | |
VALUE_FLATNESS_PRECISION | final public static int VALUE_FLATNESS_PRECISION(Code) | | |
VALUE_FONT_PRECISION | final public static int VALUE_FONT_PRECISION(Code) | | |
VALUE_GRAY_PRECISION | final public static int VALUE_GRAY_PRECISION(Code) | | |
VALUE_WIDTH_PRECISION | final public static int VALUE_WIDTH_PRECISION(Code) | | |
basicTextShow | protected void basicTextShow(byte[] text)(Code) | | |
close | public void close()(Code) | | |
compatibilityBegin | public void compatibilityBegin()(Code) | | |
compatibilityEnd | public void compatibilityEnd()(Code) | | |
copy | public void copy(CSContent otherContent)(Code) | | Copy all operations from otherContent to this .
Currently no resources are copied for otherContent
Parameters: otherContent - The source of the graphic operations. |
createFromContent | public static CSCreator createFromContent(CSContent content, IResourcesProvider resourcesProvider)(Code) | | Create a
CSCreator on an existing
CSContent . The content
may be read from a PDPage or a PDForm or can be completely new.
This is the most basic factory method where you have the freedom to
decide where the content comes from, where the resources come frome and
wher the content will be used.
Parameters: content - The content stream to write to. Parameters: resourcesProvider - The provider for the PDResources that contain theresources referenced in the CSContent. The new CSCreator |
flush | public void flush()(Code) | | Flush all pending operations on the stream.
This must be called before the getContent operation is
valid.
|
isFont | protected boolean isFont(PDFont queryFont, float queryFontSize)(Code) | | Answer true if the actual font in the text state is equal
to queryFont and queryFontSize .
Parameters: queryFont - The font to query. Parameters: queryFontSize - The font size to query. true if equal |
isNonStrokeCMYKColor | protected boolean isNonStrokeCMYKColor(float c, float m, float y, float k)(Code) | | |
isNonStrokeRGBColor | protected boolean isNonStrokeRGBColor(float r, float g, float b)(Code) | | |
isStrokeCMYKColor | protected boolean isStrokeCMYKColor(float c, float m, float y, float k)(Code) | | |
isStrokeRGBColor | protected boolean isStrokeRGBColor(float r, float g, float b)(Code) | | |
isTextMode | protected boolean isTextMode()(Code) | | |
markedContentBegin | public void markedContentBegin(COSName tag)(Code) | | |
markedContentEnd | public void markedContentEnd()(Code) | | |
markedContentPoint | public void markedContentPoint(COSName tag)(Code) | | |
pathClipEvenOdd | public void pathClipEvenOdd()(Code) | | |
pathClipNonZero | public void pathClipNonZero()(Code) | | |
pathClose | public void pathClose()(Code) | | |
pathCloseFillStrokeEvenOdd | public void pathCloseFillStrokeEvenOdd()(Code) | | |
pathCloseFillStrokeNonZero | public void pathCloseFillStrokeNonZero()(Code) | | |
pathCloseStroke | public void pathCloseStroke()(Code) | | |
pathEnd | public void pathEnd()(Code) | | |
pathFillEvenOdd | public void pathFillEvenOdd()(Code) | | |
pathFillNonZero | public void pathFillNonZero()(Code) | | |
pathFillStrokeEvenOdd | public void pathFillStrokeEvenOdd()(Code) | | |
pathFillStrokeNonZero | public void pathFillStrokeNonZero()(Code) | | |
pathStroke | public void pathStroke()(Code) | | |
penCircle | public void penCircle(float x, float y, float r)(Code) | | Draw a circle. The center of the circle is at x ,
y in user space. r defines the radius.
Parameters: x - The x coordinate of the center. Parameters: y - The y coordinate of the center. Parameters: r - The radius |
penCurveToC | public void penCurveToC(float x1, float y1, float x2, float y2, float x3, float y3)(Code) | | |
penCurveToV | public void penCurveToV(float x2, float y2, float x3, float y3)(Code) | | |
penCurveToY | public void penCurveToY(float x1, float y1, float x3, float y3)(Code) | | |
penEllipse | public void penEllipse(float x, float y, float rx, float ry)(Code) | | Draw an ellipse. The center of the ellipse is at x ,
y in user space. rx and ry
define the radius in x and y direction respectively.
Parameters: x - The x coordinate of the center. Parameters: y - The y coordinate of the center. Parameters: rx - The radius in x direction Parameters: ry - The radius in y direction |
penLineTo | public void penLineTo(float x, float y)(Code) | | |
penMoveTo | public void penMoveTo(float x, float y)(Code) | | |
penRectangle | public void penRectangle(float x, float y, float w, float h)(Code) | | |
resetStrings | protected void resetStrings()(Code) | | |
resetTextBuffer | protected void resetTextBuffer()(Code) | | |
restoreState | public void restoreState()(Code) | | |
saveState | public void saveState()(Code) | | |
setFlatnessTolerance | public void setFlatnessTolerance(float flatness)(Code) | | |
setLineCap | public void setLineCap(int style)(Code) | | |
setLineDash | public void setLineDash(float unitsOn, float unitsOff, float phase)(Code) | | Convenience method to access "setLineDash".
Parameters: unitsOn - Parameters: unitsOff - Parameters: phase - |
setLineDash | public void setLineDash(float[] pattern, float phase)(Code) | | |
setLineJoin | public void setLineJoin(int style)(Code) | | |
setLineWidth | public void setLineWidth(float w)(Code) | | |
setMiterLimit | public void setMiterLimit(float miterLimit)(Code) | | |
setNonStrokeColorCMYK | public void setNonStrokeColorCMYK(float c, float m, float y, float k)(Code) | | |
setNonStrokeColorGray | public void setNonStrokeColorGray(float gray)(Code) | | |
setNonStrokeColorRGB | public void setNonStrokeColorRGB(float red, float green, float blue)(Code) | | |
setNonStrokeColorValues | public void setNonStrokeColorValues(float[] values)(Code) | | |
setNonStrokeColorValues | public void setNonStrokeColorValues(float[] values, COSName name, PDPattern pattern)(Code) | | |
setRenderingIntent | public void setRenderingIntent(COSName intent)(Code) | | |
setStrokeColorCMYK | public void setStrokeColorCMYK(float cyan, float magenta, float yellow, float key)(Code) | | |
setStrokeColorGray | public void setStrokeColorGray(float gray)(Code) | | |
setStrokeColorRGB | public void setStrokeColorRGB(float red, float green, float blue)(Code) | | |
setStrokeColorValues | public void setStrokeColorValues(float[] values)(Code) | | |
setTextMode | protected void setTextMode(boolean b)(Code) | | |
streamEnd | protected void streamEnd()(Code) | | Close a currently open line.
|
streamEndRun | protected void streamEndRun()(Code) | | Close a currently open optimzed character sequence.
|
textBegin | public void textBegin()(Code) | | |
textEnd | public void textEnd()(Code) | | |
textLineMove | public void textLineMove(float dx, float dy)(Code) | | |
textLineMoveSetLeading | public void textLineMoveSetLeading(float dx, float dy)(Code) | | Move the current text line by dx , dy . Set
the current leading to the dy offset.
PDF graphics operator "TD"
Parameters: dx - The x offset for the new glyph starting point. Parameters: dy - The y offset for the new glyph starting point. |
textLineMoveTo | public void textLineMoveTo(float x, float y)(Code) | | Move the current text line to absolute position x ,
y .
PDF graphics operator "Td"
|
textLineNew | public void textLineNew()(Code) | | |
textMove | public void textMove(float dx, float dy)(Code) | | |
textMoveTo | public void textMoveTo(float x, float y)(Code) | | |
textSetCharSpacing | public void textSetCharSpacing(float charSpace)(Code) | | |
textSetHorizontalScaling | public void textSetHorizontalScaling(float scale)(Code) | | |
textSetLeading | public void textSetLeading(float leading)(Code) | | |
textSetRenderingMode | public void textSetRenderingMode(int rendering)(Code) | | |
textSetRise | public void textSetRise(float rise)(Code) | | |
textSetTransform | public void textSetTransform(float a, float b, float c, float d, float e, float f)(Code) | | |
textSetWordSpacing | public void textSetWordSpacing(float wordSpace)(Code) | | |
textShow | public void textShow(byte[] text, int offset, int length)(Code) | | |
textT3SetGlyphWidth | public void textT3SetGlyphWidth(float x, float y)(Code) | | |
textT3SetGlyphWidthBB | public void textT3SetGlyphWidthBB(float x, float y, float llx, float lly, float urx, float ury)(Code) | | |
transform | public void transform(float a, float b, float c, float d, float e, float f)(Code) | | |
|
|