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
IOException
public void drawImage(PDImage pdImage) throws IOException
PDFGraphicsStreamEngine
drawImage
in class PDFGraphicsStreamEngine
pdImage
- The image to draw.IOException
public void clip(int windingRule) throws IOException
PDFGraphicsStreamEngine
clip
in class PDFGraphicsStreamEngine
windingRule
- The winding rule which will be used for clipping.IOException
public void moveTo(float x, float y) throws IOException
PDFGraphicsStreamEngine
moveTo
in class PDFGraphicsStreamEngine
IOException
public void lineTo(float x, float y) throws IOException
PDFGraphicsStreamEngine
lineTo
in class PDFGraphicsStreamEngine
IOException
public void curveTo(float x1, float y1, float x2, float y2, float x3, float y3) throws IOException
PDFGraphicsStreamEngine
curveTo
in class PDFGraphicsStreamEngine
IOException
public Point2D getCurrentPoint() throws IOException
PDFGraphicsStreamEngine
getCurrentPoint
in class PDFGraphicsStreamEngine
IOException
public void closePath() throws IOException
PDFGraphicsStreamEngine
closePath
in class PDFGraphicsStreamEngine
IOException
public void endPath() throws IOException
PDFGraphicsStreamEngine
endPath
in class PDFGraphicsStreamEngine
IOException
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
public void fillAndStrokePath(int windingRule) throws IOException
PDFGraphicsStreamEngine
fillAndStrokePath
in class PDFGraphicsStreamEngine
windingRule
- The winding rule this path will use.IOException
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
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–2017 The Apache Software Foundation. All rights reserved.