# PdfPagePathObject

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in[S Extensions 18](https://developer.android.com/sdkExtensions)  
Summary:[Constants](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#constants)\|[Ctors](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#pubctors)\|[Methods](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#inhmethods)  

# PdfPagePathObject

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/graphics/pdf/component/PdfPagePathObject "View this page in Kotlin")\|Java

`
public

final

class
PdfPagePathObject
`  
`


``

extends `[PdfPageObject](https://developer.android.com/reference/android/graphics/pdf/component/PdfPageObject)`


``


`

|---|---|--------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [android.graphics.pdf.component.PdfPageObject](https://developer.android.com/reference/android/graphics/pdf/component/PdfPageObject) ||
|   | ↳ | android.graphics.pdf.component.PdfPagePathObject |

<br />

*** ** * ** ***

Represents a path object on a PDF page. This class extends[PdfPageObject](https://developer.android.com/reference/android/graphics/pdf/component/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](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#RENDER_MODE_FILL) Fill Mode : Only the interior of the glyphs is filled with the fill color.                                                              |
| `int` | [RENDER_MODE_FILL_STROKE](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#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](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#RENDER_MODE_STROKE) Stroke Mode : Only the outline of the glyphs is stroked with the stroke color.                                                      |
| `int` | [RENDER_MODE_UNKNOWN](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#RENDER_MODE_UNKNOWN) Unknown Render Mode.                                                                                                              |

|                                                                                                                               ### Public constructors                                                                                                                                ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[PdfPagePathObject](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#PdfPagePathObject(android.graphics.Path))`(`[Path](https://developer.android.com/reference/android/graphics/Path)` path) ` Constructor for the PdfPagePathObject. |

|                                                                                                                                                                                                ### Public methods                                                                                                                                                                                                 ||
|--------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` int`                                                                   | ` `[getFillColor](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#getFillColor())`() ` Returns the fill color of the object.                                                                                                                                                                   |
| ` int`                                                                   | ` `[getRenderMode](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#getRenderMode())`() ` Returns the[ERROR(RenderMode/android.graphics.pdf.component.PdfPagePathObject.RenderMode RenderMode)](https://developer.android.com/)of the object.                                                   |
| ` int`                                                                   | ` `[getStrokeColor](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#getStrokeColor())`() ` Returns the stroke color of the object.                                                                                                                                                             |
| ` float`                                                                 | ` `[getStrokeWidth](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#getStrokeWidth())`() ` Returns the stroke width of the object.                                                                                                                                                             |
| ` void`                                                                  | ` `[setFillColor](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#setFillColor(int))`(int fillColor) ` Sets the fill color of the object.                                                                                                                                                      |
| ` void`                                                                  | ` `[setRenderMode](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#setRenderMode(int))`(int renderMode) ` Sets the[ERROR(PdfPagePathObject.RenderMode/android.graphics.pdf.component.PdfPagePathObject.RenderMode PdfPagePathObject.RenderMode)](https://developer.android.com/)of the object. |
| ` void`                                                                  | ` `[setStrokeColor](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#setStrokeColor(int))`(int strokeColor) ` Sets the stroke color of the object.                                                                                                                                              |
| ` void`                                                                  | ` `[setStrokeWidth](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#setStrokeWidth(float))`(float strokeWidth) ` Sets the stroke width of the object.                                                                                                                                          |
| ` `[Path](https://developer.android.com/reference/android/graphics/Path) | ` `[toPath](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#toPath())`() ` Returns the path of the object.                                                                                                                                                                                     |

| ### Inherited methods |
|-----------------------|---|
| From class` `[android.graphics.pdf.component.PdfPageObject](https://developer.android.com/reference/android/graphics/pdf/component/PdfPageObject)` ` |------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` float[]` | ` `[getMatrix](https://developer.android.com/reference/android/graphics/pdf/component/PdfPageObject#getMatrix())`() ` Returns the transformation matrix of the object.                                                                                                                                                                                                          | | ` int`     | ` `[getPdfObjectType](https://developer.android.com/reference/android/graphics/pdf/component/PdfPageObject#getPdfObjectType())`() ` Returns the type of the page object.                                                                                                                                                                                                        | | ` void`    | ` `[setMatrix](https://developer.android.com/reference/android/graphics/pdf/component/PdfPageObject#setMatrix(android.graphics.Matrix))`(`[Matrix](https://developer.android.com/reference/android/graphics/Matrix)` matrix) ` Sets the transformation matrix of the object.                                                                                                    | | ` void`    | ` `[transform](https://developer.android.com/reference/android/graphics/pdf/component/PdfPageObject#transform(float,%20float,%20float,%20float,%20float,%20float))`(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](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(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](https://developer.android.com/reference/java/lang/Object#wait(long))`(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](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Constants

### RENDER_MODE_FILL

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in[S Extensions 18](https://developer.android.com/sdkExtensions)  

```
public static final int RENDER_MODE_FILL
```

Fill Mode : Only the interior of the glyphs is filled with the fill color.

<br />

Constant Value: 0 (0x00000000)  

### RENDER_MODE_FILL_STROKE

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in[S Extensions 18](https://developer.android.com/sdkExtensions)  

```
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.

<br />

Constant Value: 2 (0x00000002)  

### RENDER_MODE_STROKE

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in[S Extensions 18](https://developer.android.com/sdkExtensions)  

```
public static final int RENDER_MODE_STROKE
```

Stroke Mode : Only the outline of the glyphs is stroked with the stroke color.

<br />

Constant Value: 1 (0x00000001)  

### RENDER_MODE_UNKNOWN

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in[S Extensions 18](https://developer.android.com/sdkExtensions)  

```
public static final int RENDER_MODE_UNKNOWN
```

Unknown Render Mode.

<br />

Constant Value: -1 (0xffffffff)

## Public constructors

### PdfPagePathObject

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in[S Extensions 18](https://developer.android.com/sdkExtensions)  

```
public PdfPagePathObject (Path path)
```

Constructor for the PdfPagePathObject. Sets the object type to[PdfPageObjectType.PATH](https://developer.android.com/reference/android/graphics/pdf/component/PdfPageObjectType#PATH).

<br />

|                     Parameters                     ||
|--------|--------------------------------------------|
| `path` | `Path`: This value cannot be`null`. <br /> |

## Public methods

### getFillColor

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in[S Extensions 18](https://developer.android.com/sdkExtensions)  

```
public int getFillColor ()
```

Returns the fill color of the object. Returns[Color.BLACK](https://developer.android.com/reference/android/graphics/Color#BLACK)if[ERROR(/#mFillColor)](https://developer.android.com/)is not set.

<br />

|                   Returns                   ||
|-------|--------------------------------------|
| `int` | The fill color of the object. <br /> |

### getRenderMode

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in[S Extensions 18](https://developer.android.com/sdkExtensions)  

```
public int getRenderMode ()
```

Returns the[ERROR(RenderMode/android.graphics.pdf.component.PdfPagePathObject.RenderMode RenderMode)](https://developer.android.com/)of the object. Returns[ERROR(RenderMode.RENDER_MODE_FILL/android.graphics.pdf.component.PdfPagePathObject.RenderMode#RENDER_MODE_FILL RenderMode.RENDER_MODE_FILL)](https://developer.android.com/)by default if[ERROR(PdfPagePathObject.mRenderMode/android.graphics.pdf.component.PdfPagePathObject#mRenderMode PdfPagePathObject.mRenderMode)](https://developer.android.com/)is not set.

<br />

|                                                                                                                                                                                                                                                                                                                                                       Returns                                                                                                                                                                                                                                                                                                                                                        ||
|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | The[ERROR(RenderMode/android.graphics.pdf.component.PdfPagePathObject.RenderMode RenderMode)](https://developer.android.com/)of the object. Value is[RENDER_MODE_UNKNOWN](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#RENDER_MODE_UNKNOWN),[RENDER_MODE_FILL](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#RENDER_MODE_FILL),[RENDER_MODE_STROKE](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#RENDER_MODE_STROKE), or[RENDER_MODE_FILL_STROKE](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#RENDER_MODE_FILL_STROKE) <br /> |

### getStrokeColor

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in[S Extensions 18](https://developer.android.com/sdkExtensions)  

```
public int getStrokeColor ()
```

Returns the stroke color of the object.

<br />

|                    Returns                    ||
|-------|----------------------------------------|
| `int` | The stroke color of the object. <br /> |

### getStrokeWidth

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in[S Extensions 18](https://developer.android.com/sdkExtensions)  

```
public float getStrokeWidth ()
```

Returns the stroke width of the object.

<br />

|                     Returns                     ||
|---------|----------------------------------------|
| `float` | The stroke width of the object. <br /> |

### setFillColor

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in[S Extensions 18](https://developer.android.com/sdkExtensions)  

```
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)](https://developer.android.com/)is not[RENDER_MODE_FILL](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#RENDER_MODE_FILL)or[RENDER_MODE_FILL_STROKE](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#RENDER_MODE_FILL_STROKE).

<br />

|                        Parameters                        ||
|-------------|---------------------------------------------|
| `fillColor` | `int`: The fill color of the object. <br /> |

### setRenderMode

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in[S Extensions 18](https://developer.android.com/sdkExtensions)  

```
public void setRenderMode (int renderMode)
```

Sets the[ERROR(PdfPagePathObject.RenderMode/android.graphics.pdf.component.PdfPagePathObject.RenderMode PdfPagePathObject.RenderMode)](https://developer.android.com/)of the object.

<br />

|                                                                                                                                                                                                                                                                                                                                                                             Parameters                                                                                                                                                                                                                                                                                                                                                                             ||
|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `renderMode` | `int`: The[ERROR(PdfPagePathObject.RenderMode/android.graphics.pdf.component.PdfPagePathObject.RenderMode PdfPagePathObject.RenderMode)](https://developer.android.com/)to be set. Value is[RENDER_MODE_UNKNOWN](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#RENDER_MODE_UNKNOWN),[RENDER_MODE_FILL](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#RENDER_MODE_FILL),[RENDER_MODE_STROKE](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#RENDER_MODE_STROKE), or[RENDER_MODE_FILL_STROKE](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#RENDER_MODE_FILL_STROKE) <br /> |

|                                                                     Throws                                                                     ||
|--------------------------------------------------------------------------------------------------------|----------------------------------------|
| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException) | if the provided renderMode is invalid. |

### setStrokeColor

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in[S Extensions 18](https://developer.android.com/sdkExtensions)  

```
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)](https://developer.android.com/)is not[RENDER_MODE_STROKE](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#RENDER_MODE_STROKE)or[RENDER_MODE_FILL_STROKE](https://developer.android.com/reference/android/graphics/pdf/component/PdfPagePathObject#RENDER_MODE_FILL_STROKE).

<br />

|                          Parameters                          ||
|---------------|-----------------------------------------------|
| `strokeColor` | `int`: The stroke color of the object. <br /> |

### setStrokeWidth

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in[S Extensions 18](https://developer.android.com/sdkExtensions)  

```
public void setStrokeWidth (float strokeWidth)
```

Sets the stroke width of the object.

<br />

|                           Parameters                           ||
|---------------|-------------------------------------------------|
| `strokeWidth` | `float`: The stroke width of the object. <br /> |

### toPath

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in[S Extensions 18](https://developer.android.com/sdkExtensions)  

```
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.

<br />

|                                                       Returns                                                       ||
|-----------------------------------------------------------------------|----------------------------------------------|
| [Path](https://developer.android.com/reference/android/graphics/Path) | The path. This value cannot be`null`. <br /> |