public class CustomGraphicsStreamEngine extends PDFGraphicsStreamEngine
See PDFStreamEngine
for further methods which may be overridden.
Modifier | Constructor and Description |
---|---|
protected |
CustomGraphicsStreamEngine(PDPage page)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
appendRectangle(Point2D p0,
Point2D p1,
Point2D p2,
Point2D p3)
Append a rectangle to the current path.
|
void |
clip(int windingRule)
Modify the current clipping path by intersecting it with the current path.
|
void |
closePath()
Closes the current path.
|
void |
curveTo(float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
Draws a curve from the current point to (x3,y3) using (x1,y1) and (x2,y2) as control points.
|
void |
drawImage(PDImage pdImage)
Draw the image.
|
void |
endPath()
Ends the current path without filling or stroking it.
|
void |
fillAndStrokePath(int windingRule)
Fills and then strokes the path.
|
void |
fillPath(int windingRule)
Fill the path.
|
Point2D |
getCurrentPoint()
Returns the current point of the current path.
|
void |
lineTo(float x,
float y)
Draws a line from the current point to (x,y).
|
static void |
main(String[] args) |
void |
moveTo(float x,
float y)
Starts a new path at (x,y).
|
void |
run()
Runs the engine on the current page.
|
void |
shadingFill(COSName shadingName)
Fill with Shading.
|
protected void |
showGlyph(Matrix textRenderingMatrix,
PDFont font,
int code,
String unicode,
Vector displacement)
Overridden from PDFStreamEngine.
|
void |
showTextString(byte[] string)
Overridden from PDFStreamEngine.
|
void |
showTextStrings(COSArray array)
Overridden from PDFStreamEngine.
|
void |
strokePath()
Stroke the path.
|
getPage
addOperator, applyTextAdjustment, beginText, endText, getAppearance, getCurrentPage, getGraphicsStackSize, getGraphicsState, getInitialMatrix, getResources, getTextLineMatrix, getTextMatrix, operatorException, processAnnotation, processChildStream, processOperator, processOperator, processPage, processSoftMask, processTilingPattern, processTilingPattern, processTransparencyGroup, processType3Stream, registerOperatorProcessor, restoreGraphicsStack, restoreGraphicsState, saveGraphicsStack, saveGraphicsState, setLineDashPattern, setTextLineMatrix, setTextMatrix, showAnnotation, showFontGlyph, showForm, showText, showTransparencyGroup, showType3Glyph, transformedPoint, transformWidth, unsupportedOperator
protected CustomGraphicsStreamEngine(PDPage page)
page
- PDF Pagepublic static void main(String[] args) throws IOException
IOException
public void run() throws IOException
IOException
- If there is an IO error while drawing the page.public void appendRectangle(Point2D p0, Point2D p1, Point2D p2, Point2D p3) throws IOException
PDFGraphicsStreamEngine
appendRectangle
in class PDFGraphicsStreamEngine
p0
- point P0 of the rectangle.p1
- point P1 of the rectangle.p2
- point P2 of the rectangle.p3
- point P3 of the rectangle.IOException
- if something went wrong.public void drawImage(PDImage pdImage) throws IOException
PDFGraphicsStreamEngine
drawImage
in class PDFGraphicsStreamEngine
pdImage
- The image to draw.IOException
- if something went wrong.public void clip(int windingRule) throws IOException
PDFGraphicsStreamEngine
clip
in class PDFGraphicsStreamEngine
windingRule
- The winding rule which will be used for clipping.IOException
- if something went wrong.public void moveTo(float x, float y) throws IOException
PDFGraphicsStreamEngine
moveTo
in class PDFGraphicsStreamEngine
x
- x-coordinate of the target point.y
- y-coordinate of the target point.IOException
- if something went wrong.public void lineTo(float x, float y) throws IOException
PDFGraphicsStreamEngine
lineTo
in class PDFGraphicsStreamEngine
x
- x-coordinate of the end point of the line.y
- y-coordinate of the end point of the line.IOException
- if something went wrong.public void curveTo(float x1, float y1, float x2, float y2, float x3, float y3) throws IOException
PDFGraphicsStreamEngine
curveTo
in class PDFGraphicsStreamEngine
x1
- x-coordinate of the first control point.y1
- y-coordinate of the first control point.x2
- x-coordinate of the second control point.y2
- y-coordinate of the second control point.x3
- x-coordinate of the end point of the curve.y3
- y-coordinate of the end point of the curve.IOException
- if something went wrong.public Point2D getCurrentPoint() throws IOException
PDFGraphicsStreamEngine
getCurrentPoint
in class PDFGraphicsStreamEngine
IOException
- if something went wrong.public void closePath() throws IOException
PDFGraphicsStreamEngine
closePath
in class PDFGraphicsStreamEngine
IOException
- if something went wrong.public void endPath() throws IOException
PDFGraphicsStreamEngine
endPath
in class PDFGraphicsStreamEngine
IOException
- if something went wrong.public void strokePath() throws IOException
PDFGraphicsStreamEngine
strokePath
in class PDFGraphicsStreamEngine
IOException
- If there is an IO error while stroking the path.public void fillPath(int windingRule) throws IOException
PDFGraphicsStreamEngine
fillPath
in class PDFGraphicsStreamEngine
windingRule
- The winding rule this path will use.IOException
- if something went wrong.public void fillAndStrokePath(int windingRule) throws IOException
PDFGraphicsStreamEngine
fillAndStrokePath
in class PDFGraphicsStreamEngine
windingRule
- The winding rule this path will use.IOException
- if something went wrong.public void shadingFill(COSName shadingName) throws IOException
PDFGraphicsStreamEngine
shadingFill
in class PDFGraphicsStreamEngine
shadingName
- The name of the Shading Dictionary to use for this fill instruction.IOException
- if something went wrong.public void showTextString(byte[] string) throws IOException
showTextString
in class PDFStreamEngine
string
- the encoded textIOException
- if there was an error showing the textpublic void showTextStrings(COSArray array) throws IOException
showTextStrings
in class PDFStreamEngine
array
- array of encoded text strings and adjustmentsIOException
- if there was an error showing the textprotected void showGlyph(Matrix textRenderingMatrix, PDFont font, int code, String unicode, Vector displacement) throws IOException
showGlyph
in class PDFStreamEngine
textRenderingMatrix
- the current text rendering matrix, Trmfont
- the current fontcode
- internal PDF character code for the glyphunicode
- the Unicode text for this glyph, or null if the PDF does provide itdisplacement
- the displacement (i.e. advance) of the glyph in text spaceIOException
- if the glyph cannot be processedCopyright © 2002–2018 The Apache Software Foundation. All rights reserved.