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.
|
getPageaddOperator, 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, unsupportedOperatorprotected CustomGraphicsStreamEngine(PDPage page)
page - PDF Pagepublic static void main(String[] args) throws IOException
IOExceptionpublic 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
PDFGraphicsStreamEngineappendRectangle in class PDFGraphicsStreamEngineIOExceptionpublic void drawImage(PDImage pdImage) throws IOException
PDFGraphicsStreamEnginedrawImage in class PDFGraphicsStreamEnginepdImage - The image to draw.IOExceptionpublic void clip(int windingRule)
throws IOException
PDFGraphicsStreamEngineclip in class PDFGraphicsStreamEnginewindingRule - The winding rule which will be used for clipping.IOExceptionpublic void moveTo(float x,
float y)
throws IOException
PDFGraphicsStreamEnginemoveTo in class PDFGraphicsStreamEngineIOExceptionpublic void lineTo(float x,
float y)
throws IOException
PDFGraphicsStreamEnginelineTo in class PDFGraphicsStreamEngineIOExceptionpublic void curveTo(float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
throws IOException
PDFGraphicsStreamEnginecurveTo in class PDFGraphicsStreamEngineIOExceptionpublic Point2D getCurrentPoint() throws IOException
PDFGraphicsStreamEnginegetCurrentPoint in class PDFGraphicsStreamEngineIOExceptionpublic void closePath()
throws IOException
PDFGraphicsStreamEngineclosePath in class PDFGraphicsStreamEngineIOExceptionpublic void endPath()
throws IOException
PDFGraphicsStreamEngineendPath in class PDFGraphicsStreamEngineIOExceptionpublic void strokePath()
throws IOException
PDFGraphicsStreamEnginestrokePath in class PDFGraphicsStreamEngineIOException - If there is an IO error while stroking the path.public void fillPath(int windingRule)
throws IOException
PDFGraphicsStreamEnginefillPath in class PDFGraphicsStreamEnginewindingRule - The winding rule this path will use.IOExceptionpublic void fillAndStrokePath(int windingRule)
throws IOException
PDFGraphicsStreamEnginefillAndStrokePath in class PDFGraphicsStreamEnginewindingRule - The winding rule this path will use.IOExceptionpublic void shadingFill(COSName shadingName) throws IOException
PDFGraphicsStreamEngineshadingFill in class PDFGraphicsStreamEngineshadingName - The name of the Shading Dictionary to use for this fill instruction.IOExceptionpublic void showTextString(byte[] string)
throws IOException
showTextString in class PDFStreamEnginestring - the encoded textIOException - if there was an error showing the textpublic void showTextStrings(COSArray array) throws IOException
showTextStrings in class PDFStreamEnginearray - 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 PDFStreamEnginetextRenderingMatrix - 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.