|
PDF Clown 0.0.8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object it.stefanochizzolini.clown.documents.contents.composition.PrimitiveFilter
public class PrimitiveFilter
Content stream primitive filter.
It provides the basic (primitive) operations described by the PDF specification for graphics content composition.
This class leverages the object-oriented content stream modelling infrastructure, which encompasses 1st-level content stream objects (operations), 2nd-level content stream objects (graphics objects) and full graphics state support.
Constructor Summary | |
---|---|
PrimitiveFilter(ContentScanner scanner)
|
|
PrimitiveFilter(IContentContext context)
|
Method Summary | |
---|---|
ContentObject |
add(ContentObject object)
Adds a content object. |
void |
applyMatrix(double a,
double b,
double c,
double d,
double e,
double f)
Applies a transformation to the coordinate system from user space to device space [PDF:1.6:4.3.3]. |
CompositeObject |
begin(CompositeObject object)
Adds a composite object beginning it. |
LocalGraphicsState |
beginLocalState()
Begins a new nested graphics state context [PDF:1.6:4.3.1]. |
MarkedContent |
beginMarkedContent(PdfName tag)
Begins a new marked-content sequence [PDF:1.6:10.5]. |
void |
clip()
Modifies the current clipping path by intersecting it with the current path [PDF:1.6:4.4.1]. |
void |
closePath()
Closes the current subpath by appending a straight line segment from the current point to the starting point of the subpath [PDF:1.6:4.4.1]. |
void |
drawArc(RectangularShape location,
double startAngle,
double endAngle)
Draws a circular arc. |
void |
drawArc(RectangularShape location,
double startAngle,
double endAngle,
double branchWidth,
double branchRatio)
Draws an arc. |
void |
drawCurve(Point2D endPoint,
Point2D startControl,
Point2D endControl)
Draws a cubic Bezier curve from the current point [PDF:1.6:4.4.1]. |
void |
drawCurve(Point2D startPoint,
Point2D endPoint,
Point2D startControl,
Point2D endControl)
Draws a cubic Bezier curve [PDF:1.6:4.4.1]. |
void |
drawEllipse(RectangularShape location)
Draws an ellipse. |
void |
drawLine(Point2D endPoint)
Draws a line from the current point [PDF:1.6:4.4.1]. |
void |
drawLine(Point2D startPoint,
Point2D endPoint)
Draws a line [PDF:1.6:4.4.1]. |
void |
drawPolygon(Point2D[] points)
Draws a polygon. |
void |
drawPolyline(Point2D[] points)
Draws a multiple line. |
void |
drawRectangle(RectangularShape location)
Draws a rectangle [PDF:1.6:4.4.1]. |
void |
drawRectangle(RectangularShape location,
double radius)
Draws a rounded rectangle. |
void |
drawSpiral(Point2D center,
double startAngle,
double endAngle,
double branchWidth,
double branchRatio)
Draws a spiral. |
void |
end()
Ends the current (innermostly-nested) composite object. |
void |
fill()
Fills the path using the current color [PDF:1.6:4.4.2]. |
void |
fillStroke()
Fills and then strokes the path using the current colors [PDF:1.6:4.4.2]. |
void |
flush()
Serializes the contents into the content stream. |
ContentScanner |
getScanner()
Gets the content stream scanner. |
ContentScanner.GraphicsState |
getState()
Gets the current graphics state [PDF:1.6:4.3]. |
void |
rotate(double angle)
Applies a rotation to the coordinate system from user space to device space [PDF:1.6:4.2.2]. |
void |
rotate(double angle,
Point2D origin)
Applies a rotation to the coordinate system from user space to device space [PDF:1.6:4.2.2]. |
void |
scale(double ratioX,
double ratioY)
Applies a scaling to the coordinate system from user space to device space [PDF:1.6:4.2.2]. |
void |
setCharSpace(double value)
Sets the character spacing parameter [PDF:1.6:5.2.1]. |
void |
setFillColor(Color value)
Sets the nonstroking color value [PDF:1.6:4.5.7]. |
void |
setFont(Font value,
double size)
Sets the font [PDF:1.6:5.2]. |
void |
setFont(PdfName name,
double size)
Sets the font [PDF:1.6:5.2]. |
void |
setLineCap(LineCapEnum value)
Sets the line cap style [PDF:1.6:4.3.2]. |
void |
setLineDash(int phase,
int unitsOn)
Sets the line dash pattern [PDF:1.6:4.3.2]. |
void |
setLineDash(int phase,
int unitsOn,
int unitsOff)
Sets the line dash pattern [PDF:1.6:4.3.2]. |
void |
setLineJoin(LineJoinEnum value)
Sets the line join style [PDF:1.6:4.3.2]. |
void |
setLineWidth(double value)
Sets the line width [PDF:1.6:4.3.2]. |
void |
setMatrix(double a,
double b,
double c,
double d,
double e,
double f)
Sets the transformation of the coordinate system from user space to device space [PDF:1.6:4.3.3]. |
void |
setMiterLimit(double value)
Sets the miter limit [PDF:1.6:4.3.2]. |
void |
setScanner(ContentScanner value)
|
void |
setStrokeColor(Color value)
Sets the stroking color value [PDF:1.6:4.5.7]. |
void |
setTextLead(double value)
Sets the text leading [PDF:1.6:5.2.4]. |
void |
setTextRenderMode(TextRenderModeEnum value)
Sets the text rendering mode [PDF:1.6:5.2.5]. |
void |
setTextRise(double value)
Sets the text rise [PDF:1.6:5.2.6]. |
void |
setTextScale(double value)
Sets the text horizontal scaling [PDF:1.6:5.2.3]. |
void |
setWordSpace(double value)
Sets the word spacing [PDF:1.6:5.2.2]. |
Point2D[] |
showText(String value)
Shows the specified text on the page at the current location [PDF:1.6:5.3.2]. |
Link |
showText(String value,
Action action)
Shows the link associated to the specified text on the page at the current location. |
Point2D[] |
showText(String value,
Point2D location)
Shows the specified text on the page at the specified location [PDF:1.6:5.3.2]. |
Link |
showText(String value,
Point2D location,
Action action)
Shows the link associated to the specified text on the page at the specified location. |
Point2D[] |
showText(String value,
Point2D location,
AlignmentXEnum alignmentX,
AlignmentYEnum alignmentY,
double rotation)
Shows the specified text on the page at the specified location [PDF:1.6:5.3.2]. |
Link |
showText(String value,
Point2D location,
AlignmentXEnum alignmentX,
AlignmentYEnum alignmentY,
double rotation,
Action action)
Shows the link associated to the specified text on the page at the specified location. |
void |
showXObject(PdfName name)
Shows the specified external object [PDF:1.6:4.7]. |
void |
showXObject(PdfName name,
Point2D location)
Shows the specified external object at the specified position [PDF:1.6:4.7]. |
void |
showXObject(PdfName name,
Point2D location,
Dimension2D size)
Shows the specified external object at the specified position [PDF:1.6:4.7]. |
void |
showXObject(PdfName name,
Point2D location,
Dimension2D size,
AlignmentXEnum alignmentX,
AlignmentYEnum alignmentY,
double rotation)
Shows the specified external object at the specified position [PDF:1.6:4.7]. |
void |
showXObject(XObject value)
Shows the specified external object [PDF:1.6:4.7]. |
void |
showXObject(XObject value,
Point2D location)
Shows the specified external object at the specified position [PDF:1.6:4.7]. |
void |
showXObject(XObject value,
Point2D location,
Dimension2D size)
Shows the specified external object at the specified position [PDF:1.6:4.7]. |
void |
showXObject(XObject value,
Point2D location,
Dimension2D size,
AlignmentXEnum alignmentX,
AlignmentYEnum alignmentY,
double rotation)
Shows the specified external object at the specified position [PDF:1.6:4.7]. |
void |
stroke()
Strokes the path using the current color [PDF:1.6:4.4.2]. |
void |
translate(double distanceX,
double distanceY)
Applies a translation to the coordinate system from user space to device space [PDF:1.6:4.2.2]. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PrimitiveFilter(ContentScanner scanner)
public PrimitiveFilter(IContentContext context)
Method Detail |
---|
public ContentObject add(ContentObject object)
public void applyMatrix(double a, double b, double c, double d, double e, double f)
The transformation is applied to the current transformation matrix (CTM) by concatenation, i.e. it doesn't replace it.
a
- Item 0,0 of the matrix.b
- Item 0,1 of the matrix.c
- Item 1,0 of the matrix.d
- Item 1,1 of the matrix.e
- Item 2,0 of the matrix.f
- Item 2,1 of the matrix.setMatrix(double,double,double,double,double,double)
public CompositeObject begin(CompositeObject object)
end()
public LocalGraphicsState beginLocalState()
end()
public MarkedContent beginMarkedContent(PdfName tag)
end()
public void clip()
It can be validly called only just before painting the current path.
public void closePath()
public void drawArc(RectangularShape location, double startAngle, double endAngle)
location
- Arc location.startAngle
- Starting angle.endAngle
- Ending angle.stroke()
public void drawArc(RectangularShape location, double startAngle, double endAngle, double branchWidth, double branchRatio)
location
- Arc location.startAngle
- Starting angle.endAngle
- Ending angle.branchWidth
- Distance between the spiral branches. '0' value degrades to a circular arc.branchRatio
- Linear coefficient applied to the branch width. '1' value degrades to a constant branch width.stroke()
public void drawCurve(Point2D endPoint, Point2D startControl, Point2D endControl)
endPoint
- Ending point.startControl
- Starting control point.endControl
- Ending control point.stroke()
public void drawCurve(Point2D startPoint, Point2D endPoint, Point2D startControl, Point2D endControl)
startPoint
- Starting point.endPoint
- Ending point.startControl
- Starting control point.endControl
- Ending control point.stroke()
public void drawEllipse(RectangularShape location)
location
- Ellipse location.fill()
,
fillStroke()
,
stroke()
public void drawLine(Point2D endPoint)
endPoint
- Ending point.stroke()
public void drawLine(Point2D startPoint, Point2D endPoint)
startPoint
- Starting point.endPoint
- Ending point.stroke()
public void drawPolygon(Point2D[] points)
A polygon is the same as a multiple line except that it's a closed path.
points
- Points.fill()
,
fillStroke()
,
stroke()
public void drawPolyline(Point2D[] points)
points
- Points.stroke()
public void drawRectangle(RectangularShape location)
location
- Rectangle location.fill()
,
fillStroke()
,
stroke()
public void drawRectangle(RectangularShape location, double radius)
location
- Rectangle location.radius
- Vertex radius, '0' value degrades to squared vertices.fill()
,
fillStroke()
,
stroke()
public void drawSpiral(Point2D center, double startAngle, double endAngle, double branchWidth, double branchRatio)
center
- Spiral center.startAngle
- Starting angle.endAngle
- Ending angle.branchWidth
- Distance between the spiral branches.branchRatio
- Linear coefficient applied to the branch width.stroke()
public void end()
begin(CompositeObject)
public void fill()
setFillColor(Color)
public void fillStroke()
setFillColor(Color)
,
setStrokeColor(Color)
public void flush()
public ContentScanner getScanner()
public ContentScanner.GraphicsState getState()
public void rotate(double angle)
angle
- Rotational counterclockwise angle.applyMatrix(double,double,double,double,double,double)
public void rotate(double angle, Point2D origin)
angle
- Rotational counterclockwise angle.origin
- Rotational pivot point; it becomes the new coordinates origin.applyMatrix(double,double,double,double,double,double)
public void scale(double ratioX, double ratioY)
ratioX
- Horizontal scaling ratio.ratioY
- Vertical scaling ratio.applyMatrix(double,double,double,double,double,double)
public void setCharSpace(double value)
public void setFillColor(Color value)
setStrokeColor(Color)
public void setFont(PdfName name, double size)
name
- Resource identifier of the font.size
- Scaling factor (points).public void setFont(Font value, double size)
The value
is checked for presence in the current resource
dictionary: if it isn't available, it's automatically added. If you need to
avoid such a behavior, use setFont(PdfName,double)
.
value
- Font.size
- Scaling factor (points).public void setTextScale(double value)
public void setTextLead(double value)
public void setLineCap(LineCapEnum value)
public void setLineDash(int phase, int unitsOn)
phase
- Distance into the dash pattern at which to start the dash.unitsOn
- Length of evenly alternating dashes and gaps.public void setLineDash(int phase, int unitsOn, int unitsOff)
phase
- Distance into the dash pattern at which to start the dash.unitsOn
- Length of dashes.unitsOff
- Length of gaps.public void setLineJoin(LineJoinEnum value)
public void setLineWidth(double value)
public void setMatrix(double a, double b, double c, double d, double e, double f)
The transformation replaces the current transformation matrix (CTM).
a
- Item 0,0 of the matrix.b
- Item 0,1 of the matrix.c
- Item 1,0 of the matrix.d
- Item 1,1 of the matrix.e
- Item 2,0 of the matrix.f
- Item 2,1 of the matrix.applyMatrix(double,double,double,double,double,double)
public void setMiterLimit(double value)
public void setScanner(ContentScanner value)
getScanner()
public void setStrokeColor(Color value)
setFillColor(Color)
public void setTextRenderMode(TextRenderModeEnum value)
public void setTextRise(double value)
public void setWordSpace(double value)
public Point2D[] showText(String value)
value
- Text to show.
public Link showText(String value, Action action)
value
- Text to show.action
- Action to apply when the link is activated.
public Point2D[] showText(String value, Point2D location)
value
- Text to show.location
- Position at which showing the text.
public Link showText(String value, Point2D location, Action action)
value
- Text to show.location
- Position at which showing the text.action
- Action to apply when the link is activated.
public Point2D[] showText(String value, Point2D location, AlignmentXEnum alignmentX, AlignmentYEnum alignmentY, double rotation)
value
- Text to show.location
- Anchor position at which showing the text.alignmentX
- Horizontal alignment.alignmentY
- Vertical alignment.rotation
- Rotational counterclockwise angle.
public Link showText(String value, Point2D location, AlignmentXEnum alignmentX, AlignmentYEnum alignmentY, double rotation, Action action)
value
- Text to show.location
- Anchor position at which showing the text.alignmentX
- Horizontal alignment.alignmentY
- Vertical alignment.rotation
- Rotational counterclockwise angle.action
- Action to apply when the link is activated.
public void showXObject(PdfName name)
name
- Resource identifier of the external object.public void showXObject(XObject value)
The value
is checked for presence in the current resource
dictionary: if it isn't available, it's automatically added. If you need to
avoid such a behavior, use #showXObject(PdfName)
.
value
- External object.public void showXObject(PdfName name, Point2D location)
name
- Resource identifier of the external object.location
- Position at which showing the external object.public void showXObject(XObject value, Point2D location)
The value
is checked for presence in the current resource
dictionary: if it isn't available, it's automatically added. If you need to
avoid such a behavior, use #showXObject(PdfName,Point2D)
.
value
- External object.location
- Position at which showing the external object.public void showXObject(PdfName name, Point2D location, Dimension2D size)
name
- Resource identifier of the external object.location
- Position at which showing the external object.size
- Size of the external object.public void showXObject(XObject value, Point2D location, Dimension2D size)
The value
is checked for presence in the current resource
dictionary: if it isn't available, it's automatically added. If you need to
avoid such a behavior, use #showXObject(PdfName,Point2D,Dimension2D)
.
value
- External object.location
- Position at which showing the external object.size
- Size of the external object.public void showXObject(PdfName name, Point2D location, Dimension2D size, AlignmentXEnum alignmentX, AlignmentYEnum alignmentY, double rotation)
name
- Resource identifier of the external object.location
- Position at which showing the external object.size
- Size of the external object.alignmentX
- Horizontal alignment.alignmentY
- Vertical alignment.rotation
- Rotational counterclockwise angle.public void showXObject(XObject value, Point2D location, Dimension2D size, AlignmentXEnum alignmentX, AlignmentYEnum alignmentY, double rotation)
The value
is checked for presence in the current resource
dictionary: if it isn't available, it's automatically added. If you need to
avoid such a behavior, use #showXObject(PdfName,Point2D,Dimension2D,AlignmentXEnum,AlignmentYEnum,double)
.
value
- External object.location
- Position at which showing the external object.size
- Size of the external object.alignmentX
- Horizontal alignment.alignmentY
- Vertical alignment.rotation
- Rotational counterclockwise angle.public void stroke()
setStrokeColor(Color)
public void translate(double distanceX, double distanceY)
distanceX
- Horizontal distance.distanceY
- Vertical distance.applyMatrix(double,double,double,double,double,double)
|
PDF Clown 0.0.8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |