PDF4Java Reference Documentation
com.o2sol.pdf4java.graphics Package / PDFCanvas Class
Collapse All Expand All Members Options: Show All Members Options: Filtered
Include Inherited Members
Include Protected Members
In This Topic

PDFCanvas Class Methods
In This Topic

For a list of all members of this type, see PDFCanvas members.

Public Methods

| Name | Description
--- | --- | ---
| beginArtifactMarkedContent | Begins an artifact marked content sequence. Each beginArtifactMarkedContent call must be paired with a call.
| beginMarkedContent | Overloaded. Begins marked content sequence. Each beginMarkedContent call must be paired with a call.
| beginStructureElement | Overloaded. Begins a marked content sequence associated with a object. Each beginStructureElement call must be paired with a call.
| clearGraphics | This method supports the internal library infrastructure and should not be used by external client code.
| compressAndClose | Compresses the graphic content and closes the graphics surface. Call this method to compress the graphic content and reduce memory usage. If this method is not called, the graphic content is stored uncompressed in the PDF file. After calling this method no more drawing is allowed on the graphics.
| drawArc | Overloaded. Draws an arc representing a portion of an ellipse specified by a pair of coordinates, a width, and a height.
| drawBarcode | Draws a barcode at the specified position.
| drawBezier | Overloaded. Draws a Bézier spline specified by four Objects.
| drawChord | Overloaded. Draws a chord representing a region bounded by the intersection of an ellipse and a line segment, called a secant, specified by a pair of coordinates, a width and a height.
| drawCloud | Draws a cloud shape specified by an array of points.
| drawDonut | Overloaded. This method supports the internal library infrastructure and should not be used by external client code.
| drawEllipse | Overloaded. Draws an ellipse defined by a bounding rectangle specified by coordinates for the upper-left corner of the rectangle, a height, and a width.
| drawFormattedContent | Overloaded. Draws the formatted content on the graphics surface at the specified position.
| drawFormXObject | Overloaded. Draws the specified at the specified location and with the specified size.
| drawImage | Overloaded. Draws the specified at the specified location and with the specified size. If width is zero or negative then width is automatically computed in order to keep the original aspect ratio. If height is zero or negative then height is automatically computed in order to keep the original aspect ratio. If both width and height are negative then the image is scaled automatically to fit the given area and the original aspect ratio is kept.
| drawLine | Overloaded. Draws a line connecting the two points specified by the coordinate pairs.
| drawPath | Overloaded. Draws a .
| drawPie | Overloaded. Draws a pie shape defined by an ellipse specified by a coordinate pair, a width, a height, and two radial lines.
| drawRectangle | Overloaded. Draws a rectangle specified by a coordinate pair, a width, and a height.
| drawRoundRectangle | Overloaded. Draws a rounded rectangle specified by a coordinate pair, a width, and a height.
| drawShading | Draws a PDF shading. The position of the shading is defined on the object.
| drawStencilMask | Overloaded. Draws the specified at the specified location and with the specified size. A stencil mask is a B/W image where the 1 pixels are left transparent and 0 pixels are filled with the brush. If width is zero or negative then width is automatically computed in order to keep the original aspect ratio. If height is zero or negative then height is automatically computed in order to keep the original aspect ratio. If both width and height are negative then the stencil mask is scaled automatically to fit the given area and the original aspect ratio is kept.
| drawString | Overloaded. Draws the specified text string at the specified location with the specified and @see com.o2sol.pdf4java.graphics.PDFFont Objects.
| endMarkedContent | Ends a marked content sequence.
| endStructureElement | Ends a marked content sequence associated with a com.o2sol.pdf4java.logicalstructure.PDFStructureElement object.
| getActiveGraphicsState | This method supports the internal library infrastructure and should not be used by external client code.
| getCanvasCosStream | This method supports the internal library infrastructure and should not be used by external client code.
| getContainer | This method supports the internal library infrastructure and should not be used by external client code.
| getWorkBuffer | This method supports the internal library infrastructure and should not be used by external client code.
| getWorkBuffer2 | This method supports the internal library infrastructure and should not be used by external client code.
| multiplyTransform | Multiplies the current transformation of this graphics and specified the matrix.
| restoreGraphicsState | Restores the current graphics state of this canvas.
| rotateTransform | Applies the specified rotation to the transformation matrix of this canvas.
| saveGraphicsState | Saves the current graphics state of this canvas
| scaleTransform | Applies the specified scaling operation to the transformation matrix of this graphics by prepending it to the current transformation matrix.
| setCanvasCosStream | This method supports the internal library infrastructure and should not be used by external client code.
| setClip | Overloaded. Sets the clipping region of this graphics to the specified path. The actual clipping path is the intersection of the previous clipping path with this new clipping path. It is recommended to save the graphics state (see method) before setting a clipping path and restore the graphics state (see method) after the clipping path is no longer needed.
| setExtendedGraphicState | Sets a new graphics state in this graphics Object.
| translateTransform | Changes the origin of the coordinate system by prepending the specified translation to the transformation matrix of this canvas.

Top
See Also

#### Reference

PDFCanvas Class
com.o2sol.pdf4java.graphics Package

© 2025 O2 Solutions All Rights Reserved.

Send comments on this topic.