PdfPagePathObject
public
final
class
PdfPagePathObject
extends PdfPageObject
java.lang.Object | ||
↳ | 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 | |
---|---|
int |
RENDER_MODE_FILL
Fill Mode : Only the interior of the glyphs is filled with the fill color. |
int |
RENDER_MODE_FILL_STROKE
FillStroke Mode : Both the interior and outline of the glyphs are rendered using the fill abd stroke colors respectively. |
int |
RENDER_MODE_STROKE
Stroke Mode : Only the outline of the glyphs is stroked with the stroke color. |
int |
RENDER_MODE_UNKNOWN
Unknown Render Mode. |
Public constructors | |
---|---|
PdfPagePathObject(Path path)
Constructor for the PdfPagePathObject. |
Public methods | |
---|---|
int
|
getFillColor()
Returns the fill color of the object. |
int
|
getRenderMode()
Returns the |
int
|
getStrokeColor()
Returns the stroke color of the object. |
float
|
getStrokeWidth()
Returns the stroke width of the object. |
void
|
setFillColor(int fillColor)
Sets the fill color of the object. |
void
|
setRenderMode(int renderMode)
Sets the |
void
|
setStrokeColor(int strokeColor)
Sets the stroke color of the object. |
void
|
setStrokeWidth(float strokeWidth)
Sets the stroke width of the object. |
Path
|
toPath()
Returns the path of the object. |
Inherited methods | |
---|---|
Constants
RENDER_MODE_FILL
public static final int RENDER_MODE_FILL
Fill Mode : Only the interior of the glyphs is filled with the fill color.
Constant Value: 0 (0x00000000)
RENDER_MODE_FILL_STROKE
public static final int RENDER_MODE_FILL_STROKE
FillStroke Mode : Both the interior and outline of the glyphs are rendered using the fill abd stroke colors respectively.
Constant Value: 2 (0x00000002)
RENDER_MODE_STROKE
public static final int RENDER_MODE_STROKE
Stroke Mode : Only the outline of the glyphs is stroked with the stroke color.
Constant Value: 1 (0x00000001)
RENDER_MODE_UNKNOWN
public static final int RENDER_MODE_UNKNOWN
Unknown Render Mode.
Constant Value: -1 (0xffffffff)
Public constructors
PdfPagePathObject
public 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
public int getFillColor ()
Returns the fill color of the object.
Returns Color.BLACK
if ERROR(/#mFillColor)
is not set.
Returns | |
---|---|
int |
The fill color of the object. |
getRenderMode
public int getRenderMode ()
Returns the ERROR(RenderMode/android.graphics.pdf.component.PdfPagePathObject.RenderMode RenderMode)
of the object.
Returns ERROR(RenderMode.RENDER_MODE_FILL/android.graphics.pdf.component.PdfPagePathObject.RenderMode#RENDER_MODE_FILL RenderMode.RENDER_MODE_FILL)
by default
if ERROR(PdfPagePathObject.mRenderMode/android.graphics.pdf.component.PdfPagePathObject#mRenderMode PdfPagePathObject.mRenderMode)
is not set.
Returns | |
---|---|
int |
The ERROR(RenderMode/android.graphics.pdf.component.PdfPagePathObject.RenderMode RenderMode) of the object.
Value is RENDER_MODE_UNKNOWN , RENDER_MODE_FILL , RENDER_MODE_STROKE , or RENDER_MODE_FILL_STROKE |
getStrokeColor
public int getStrokeColor ()
Returns the stroke color of the object.
Returns | |
---|---|
int |
The stroke color of the object. |
getStrokeWidth
public float getStrokeWidth ()
Returns the stroke width of the object.
Returns | |
---|---|
float |
The stroke width of the object. |
setFillColor
public void setFillColor (int fillColor)
Sets the fill color of the object.
Note: The fillColor cannot be transparent and
setting the fillColor will have no effect if ERROR(RenderMode/android.graphics.pdf.component.PdfPagePathObject.RenderMode RenderMode)
is not
RENDER_MODE_FILL
or RENDER_MODE_FILL_STROKE
.
Parameters | |
---|---|
fillColor |
int : The fill color of the object. |
setRenderMode
public void setRenderMode (int renderMode)
Sets the ERROR(PdfPagePathObject.RenderMode/android.graphics.pdf.component.PdfPagePathObject.RenderMode PdfPagePathObject.RenderMode)
of the object.
Parameters | |
---|---|
renderMode |
int : The ERROR(PdfPagePathObject.RenderMode/android.graphics.pdf.component.PdfPagePathObject.RenderMode PdfPagePathObject.RenderMode) to be set.
Value is RENDER_MODE_UNKNOWN , RENDER_MODE_FILL , RENDER_MODE_STROKE , or RENDER_MODE_FILL_STROKE |
Throws | |
---|---|
IllegalArgumentException |
if the provided renderMode is invalid. |
setStrokeColor
public void setStrokeColor (int strokeColor)
Sets the stroke color of the object.
Note: The strokeColor cannot be transparent and
setting the strokeColor will have no effect if ERROR(RenderMode/android.graphics.pdf.component.PdfPagePathObject.RenderMode RenderMode)
is not
RENDER_MODE_STROKE
or RENDER_MODE_FILL_STROKE
.
Parameters | |
---|---|
strokeColor |
int : The stroke color of the object. |
setStrokeWidth
public void setStrokeWidth (float strokeWidth)
Sets the stroke width of the object.
Parameters | |
---|---|
strokeWidth |
float : The stroke width of the object. |
toPath
public Path toPath ()
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.
Returns | |
---|---|
Path |
The path.
This value cannot be null . |