PdfPagePathObject
class PdfPagePathObject : PdfPageObject
kotlin.Any | ||
↳ | android.graphics.pdf.component.PdfPageObject | |
↳ | android.graphics.pdf.component.PdfPagePathObject |
Represents a path object on a PDF page. This class extends PdfPageObject
and provides methods to access and modify the path's content, such as its shape, fill color, stroke color and line width.
Summary
Constants | |
---|---|
static Int |
Fill Mode : Only the interior of the glyphs is filled with the fill color. |
static Int |
FillStroke Mode : Both the interior and outline of the glyphs are rendered using the fill abd stroke colors respectively. |
static Int |
Stroke Mode : Only the outline of the glyphs is stroked with the stroke color. |
static Int |
Unknown Render Mode. |
Public constructors | |
---|---|
PdfPagePathObject(path: Path) Constructor for the PdfPagePathObject. |
Public methods | |
---|---|
Int |
Returns the fill color of the object. |
Int |
Returns the android. |
Int |
Returns the stroke color of the object. |
Float |
Returns the stroke width of the object. |
Unit |
setFillColor(fillColor: Int) Sets the fill color of the object. |
Unit |
setRenderMode(renderMode: Int) Sets the android. |
Unit |
setStrokeColor(strokeColor: Int) Sets the stroke color of the object. |
Unit |
setStrokeWidth(strokeWidth: Float) Sets the stroke width of the object. |
Path |
toPath() Returns the path of the object. |
Inherited functions | |
---|---|
Constants
RENDER_MODE_FILL
static val RENDER_MODE_FILL: Int
Fill Mode : Only the interior of the glyphs is filled with the fill color.
Value: 0
RENDER_MODE_FILL_STROKE
static val RENDER_MODE_FILL_STROKE: Int
FillStroke Mode : Both the interior and outline of the glyphs are rendered using the fill abd stroke colors respectively.
Value: 2
RENDER_MODE_STROKE
static val RENDER_MODE_STROKE: Int
Stroke Mode : Only the outline of the glyphs is stroked with the stroke color.
Value: 1
RENDER_MODE_UNKNOWN
static val RENDER_MODE_UNKNOWN: Int
Unknown Render Mode.
Value: -1
Public constructors
PdfPagePathObject
PdfPagePathObject(path: Path)
Constructor for the PdfPagePathObject. Sets the object type to PdfPageObjectType.PATH
.
Parameters | |
---|---|
path |
Path: This value cannot be null . |
Public methods
getFillColor
fun getFillColor(): Int
Returns the fill color of the object. Returns Color.BLACK
if #mFillColor is not set.
Return | |
---|---|
Int |
The fill color of the object. |
getRenderMode
fun getRenderMode(): Int
Returns the android.graphics.pdf.component.PdfPagePathObject.RenderMode of the object. Returns android.graphics.pdf.component.PdfPagePathObject.RenderMode#RENDER_MODE_FILL by default if android.graphics.pdf.component.PdfPagePathObject#mRenderMode is not set.
Return | |
---|---|
Int |
The android.graphics.pdf.component.PdfPagePathObject.RenderMode of the object. Value is android.graphics.pdf.component.PdfPagePathObject#RENDER_MODE_UNKNOWN , android.graphics.pdf.component.PdfPagePathObject#RENDER_MODE_FILL , android.graphics.pdf.component.PdfPagePathObject#RENDER_MODE_STROKE , or android.graphics.pdf.component.PdfPagePathObject#RENDER_MODE_FILL_STROKE |
getStrokeColor
fun getStrokeColor(): Int
Returns the stroke color of the object.
Return | |
---|---|
Int |
The stroke color of the object. |
getStrokeWidth
fun getStrokeWidth(): Float
Returns the stroke width of the object.
Return | |
---|---|
Float |
The stroke width of the object. |
setFillColor
fun setFillColor(fillColor: Int): Unit
Sets the fill color of the object.
Note: The fillColor cannot be transparent and setting the fillColor will have no effect if android.graphics.pdf.component.PdfPagePathObject.RenderMode is not RENDER_MODE_FILL
or RENDER_MODE_FILL_STROKE
.
Parameters | |
---|---|
fillColor |
Int: The fill color of the object. |
setRenderMode
fun setRenderMode(renderMode: Int): Unit
Sets the android.graphics.pdf.component.PdfPagePathObject.RenderMode of the object.
Parameters | |
---|---|
renderMode |
Int: The android.graphics.pdf.component.PdfPagePathObject.RenderMode to be set. Value is android.graphics.pdf.component.PdfPagePathObject#RENDER_MODE_UNKNOWN , android.graphics.pdf.component.PdfPagePathObject#RENDER_MODE_FILL , android.graphics.pdf.component.PdfPagePathObject#RENDER_MODE_STROKE , or android.graphics.pdf.component.PdfPagePathObject#RENDER_MODE_FILL_STROKE |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if the provided renderMode is invalid. |
setStrokeColor
fun setStrokeColor(strokeColor: Int): Unit
Sets the stroke color of the object.
Note: The strokeColor cannot be transparent and setting the strokeColor will have no effect if android.graphics.pdf.component.PdfPagePathObject.RenderMode is not RENDER_MODE_STROKE
or RENDER_MODE_FILL_STROKE
.
Parameters | |
---|---|
strokeColor |
Int: The stroke color of the object. |
setStrokeWidth
fun setStrokeWidth(strokeWidth: Float): Unit
Sets the stroke width of the object.
Parameters | |
---|---|
strokeWidth |
Float: The stroke width of the object. |
toPath
fun toPath(): Path
Returns the path of the object. The returned path object might be an approximation of the one used to create the original one if the original object has elements with curvature.
Note: The path is immutable because the underlying library does not allow modifying the path once it is created.
Return | |
---|---|
Path |
The path. This value cannot be null . |