java.lang.Object
org.sejda.sambox.contentstream.PDFStreamEngine
org.sejda.sambox.contentstream.PDFGraphicsStreamEngine
- Direct Known Subclasses:
PageDrawer
PDFStreamEngine subclass for advanced processing of graphics. This class should be subclassed by end users looking to
hook into graphics operations.
- Author:
- John Hewson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidappendRectangle(Point2D p0, Point2D p1, Point2D p2, Point2D p3) Append a rectangle to the current path.abstract voidclip(int windingRule) Modify the current clipping path by intersecting it with the current path.abstract voidCloses the current path.abstract voidcurveTo(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.abstract voidDraw the image.abstract voidendPath()Ends the current path without filling or stroking it.abstract voidfillAndStrokePath(int windingRule) Fills and then strokes the path.abstract voidfillPath(int windingRule) Fill the path.abstract Point2DReturns the current point of the current path.protected final PDPagegetPage()abstract voidlineTo(float x, float y) Draws a line from the current point to (x,y).abstract voidmoveTo(float x, float y) Starts a new path at (x,y).abstract voidshadingFill(COSName shadingName) Fill with Shading.abstract voidStroke the path.Methods inherited from class org.sejda.sambox.contentstream.PDFStreamEngine
addOperator, addOperatorIfAbsent, applyTextAdjustment, beginMarkedContentSequence, beginText, decreaseLevel, endMarkedContentSequence, endText, getAppearance, getCurrentPage, getGraphicsStackSize, getGraphicsState, getInitialMatrix, getLevel, getResources, getTextLineMatrix, getTextMatrix, increaseLevel, operatorException, processAnnotation, processChildStream, processOperator, processOperator, processPage, processSoftMask, processStream, processTilingPattern, processTilingPattern, processTransparencyGroup, processType3Stream, restoreGraphicsStack, restoreGraphicsState, saveGraphicsStack, saveGraphicsState, setLineDashPattern, setTextLineMatrix, setTextMatrix, showAnnotation, showFontGlyph, showForm, showGlyph, showText, showTextString, showTextStrings, showTransparencyGroup, showType3Glyph, transformedPoint, transformWidth, unsupportedOperator
-
Constructor Details
-
PDFGraphicsStreamEngine
Constructor.
-
-
Method Details
-
getPage
- Returns:
- the page.
-
appendRectangle
public abstract void appendRectangle(Point2D p0, Point2D p1, Point2D p2, Point2D p3) throws IOException Append a rectangle to the current path.- Parameters:
p0- point P0 of the rectangle.p1- point P1 of the rectangle.p2- point P2 of the rectangle.p3- point P3 of the rectangle.- Throws:
IOException- if something went wrong.
-
drawImage
Draw the image.- Parameters:
pdImage- The image to draw.- Throws:
IOException- if something went wrong.
-
clip
Modify the current clipping path by intersecting it with the current path. The clipping path will not be updated until the succeeding painting operator is called.- Parameters:
windingRule- The winding rule which will be used for clipping.- Throws:
IOException
-
moveTo
Starts a new path at (x,y).- Throws:
IOException
-
lineTo
Draws a line from the current point to (x,y).- Throws:
IOException
-
curveTo
public abstract void curveTo(float x1, float y1, float x2, float y2, float x3, float y3) throws IOException Draws a curve from the current point to (x3,y3) using (x1,y1) and (x2,y2) as control points.- Throws:
IOException
-
getCurrentPoint
Returns the current point of the current path.- Throws:
IOException
-
closePath
Closes the current path.- Throws:
IOException
-
endPath
Ends the current path without filling or stroking it. The clipping path is updated here.- Throws:
IOException
-
strokePath
Stroke the path.- Throws:
IOException- If there is an IO error while stroking the path.
-
fillPath
Fill the path.- Parameters:
windingRule- The winding rule this path will use.- Throws:
IOException
-
fillAndStrokePath
Fills and then strokes the path.- Parameters:
windingRule- The winding rule this path will use.- Throws:
IOException
-
shadingFill
Fill with Shading.- Parameters:
shadingName- The name of the Shading Dictionary to use for this fill instruction.- Throws:
IOException
-