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 ERROR(RenderMode/android.graphics.pdf.component.PdfPagePathObject.RenderMode RenderMode) of the object.

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 ERROR(PdfPagePathObject.RenderMode/android.graphics.pdf.component.PdfPagePathObject.RenderMode PdfPagePathObject.RenderMode) of the object.

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

Added in S Extensions 18
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

Added in S Extensions 18
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

Added in S Extensions 18
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

Added in S Extensions 18
public static final int RENDER_MODE_UNKNOWN

Unknown Render Mode.

Constant Value: -1 (0xffffffff)

Public constructors

PdfPagePathObject

Added in S Extensions 18
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

Added in S Extensions 18
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.

getStrokeColor

Added in S Extensions 18
public int getStrokeColor ()

Returns the stroke color of the object.

Returns
int The stroke color of the object.

getStrokeWidth

Added in S Extensions 18
public float getStrokeWidth ()

Returns the stroke width of the object.

Returns
float The stroke width of the object.

setFillColor

Added in S Extensions 18
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.

setStrokeColor

Added in S Extensions 18
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

Added in S Extensions 18
public void setStrokeWidth (float strokeWidth)

Sets the stroke width of the object.

Parameters
strokeWidth float: The stroke width of the object.

toPath

Added in S Extensions 18
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.