PdfPagePathObject  |  API reference  |  Android Developers


public final class PdfPagePathObject
extends PdfPageObject



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

From class android.graphics.pdf.component.PdfPageObject

float[] getMatrix()

Returns the transformation matrix of the object.

int getPdfObjectType()

Returns the type of the page object.

void setMatrix(Matrix matrix)

Sets the transformation matrix of the object.

void transform(float a, float b, float c, float d, float e, float f)

Transform the page object The matrix is composed as: |a c e| |b d f| and can be used to scale, rotate, shear and translate the |page_object|.

From class java.lang.Object

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

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.

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.

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.