# GraphicState Class

> The graphic state is an internal data structure in a PDF file.

- Product: Adobe PDF Library 18
- Language: Java
- Version: APDFL18.0.5PlusP2a
- HTML page: https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/GraphicState
- Version index: https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/llms.txt

```java
class GraphicState
```

**Namespace:** `com::datalogics::PDFL`

## Description

The graphic state is an internal data structure in a PDF file. The graphics state holds the parameters that describe graphics within that file.

These parameters define how individual graphics are presented on the page, including layers and transparencies.

**Referenced by:** [`Form`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Form.md), [`Image`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Image.md), [`Path`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Path.md), [`Shading`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Shading.md), [`Text`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Text.md), [`TextRun`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/TextRun.md)

**Uses types:** [`Color`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Color.md), [`ExtendedGraphicState`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/ExtendedGraphicState.md)

## Constructors

### GraphicState

```java
com.datalogics.PDFL.GraphicState.GraphicState()
```

*constructor*

Create a new default GraphicState.

## Methods

### delete

```java
synchronized void com.datalogics.PDFL.GraphicState.delete(Boolean disposing)
```

*protected*

**Parameters**

- `disposing` (`Boolean`)

**Returns:** `synchronized void`

### delete

```java
synchronized void com.datalogics.PDFL.GraphicState.delete()
```

**Returns:** `synchronized void`

### finalize

```java
void com.datalogics.PDFL.GraphicState.finalize()
```

*protected*

**Returns:** `void`

### getDashPattern

```java
java.util.List< Double > com.datalogics.PDFL.GraphicState.getDashPattern()
```

**Returns:** `java.util.List< Double >`

A list containing the dash phase followed by the contents of the DashPattern.

The line DashPattern controls the pattern of dashes and gaps used to stroke paths. It is specified by a dash phase and then a series of elements of a DashPattern list. The DashPattern's members are numbers that specify the lengths of alternating dashes and gaps; the numbers must be nonnegative and not all zero. The dash phase specifies the distance into the dash pattern at which to start the dash. The elements of both the DashPattern List and the dash phase are expressed in user space units. This retrieves the DashPattern used by the Pattern list current graphic state.

### getExtendedGraphicState

```java
ExtendedGraphicState com.datalogics.PDFL.GraphicState.getExtendedGraphicState()
```

**Returns:** [`ExtendedGraphicState`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/ExtendedGraphicState.md)

The ExtendedGraphicState, which can contain additional graphic state parameters.

### getFillColor

```java
Color com.datalogics.PDFL.GraphicState.getFillColor()
```

**Returns:** [`Color`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Color.md)

The fill color of the GraphicState.

### getLineCap

```java
LineCap com.datalogics.PDFL.GraphicState.getLineCap()
```

**Returns:** `LineCap`

The line cap used by the current GraphicState.

### getLineFlatness

```java
double com.datalogics.PDFL.GraphicState.getLineFlatness()
```

**Returns:** `double`

The line flatness corresponding to the i operator.Default is 1.0.

### getLineJoin

```java
LineJoin com.datalogics.PDFL.GraphicState.getLineJoin()
```

**Returns:** `LineJoin`

The line join style used by the current GraphicState.

### getMiterLimit

```java
double com.datalogics.PDFL.GraphicState.getMiterLimit()
```

**Returns:** `double`

The miter limit corresponding to the M operator.Default is 10.0.

### getRenderIntent

```java
RenderIntent com.datalogics.PDFL.GraphicState.getRenderIntent()
```

**Returns:** `RenderIntent`

A color rendering intent corresponding to the Intent key in the image dictionary. The default is RelColorimetric.

### getStrokeColor

```java
Color com.datalogics.PDFL.GraphicState.getStrokeColor()
```

**Returns:** [`Color`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Color.md)

The stroke color of the GraphicState.

### getWidth

```java
double com.datalogics.PDFL.GraphicState.getWidth()
```

**Returns:** `double`

The width used for drawing by the current GraphicState.

### setDashPattern

```java
void com.datalogics.PDFL.GraphicState.setDashPattern(java.util.List< Double > DashPattern)
```

**Parameters**

- `DashPattern` (`java.util.List< Double >`): A list containing the dash phase followed by the contents of the DashPattern.

**Returns:** `void`

The line DashPattern controls the pattern of dashes and gaps used to stroke paths. It is specified by a dash phase and then a series of elements of a DashPattern list. The DashPattern's members are numbers that specify the lengths of alternating dashes and gaps; the numbers must be nonnegative and not all zero. The dash phase specifies the distance into the dash pattern at which to start the dash. The elements of both the DashPattern List and the dash phase are expressed in user space units. This retrieves the DashPattern used by the Pattern list current graphic state.

### setExtendedGraphicState

```java
void com.datalogics.PDFL.GraphicState.setExtendedGraphicState(ExtendedGraphicState extendedGraphicState)
```

**Parameters**

- `extendedGraphicState` ([`ExtendedGraphicState`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/ExtendedGraphicState.md))

**Returns:** `void`

The ExtendedGraphicState, which can contain additional graphic state parameters.

### setFillColor

```java
void com.datalogics.PDFL.GraphicState.setFillColor(Color fillcolor)
```

**Parameters**

- `fillcolor` ([`Color`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Color.md)): (DeviceGray, GrayScalevalue or fillcolor (DeviceRGB, Redvalue, Greenvalue, Bluevalue or fillcolor (DeviceCMYK, Cyanvalue, Magentavalue, Yellowvalue, Blackvalue

**Returns:** `void`

The fill color of the GraphicState.

### setLineCap

```java
void com.datalogics.PDFL.GraphicState.setLineCap(LineCap LineCap)
```

**Parameters**

- `LineCap` (`LineCap`)

**Returns:** `void`

The line cap used by the current GraphicState.

### setLineFlatness

```java
void com.datalogics.PDFL.GraphicState.setLineFlatness(double flatness)
```

**Parameters**

- `flatness` (`double`)

**Returns:** `void`

The line flatness corresponding to the i operator.Default is 1.0.

### setLineJoin

```java
void com.datalogics.PDFL.GraphicState.setLineJoin(LineJoin LineJoin)
```

**Parameters**

- `LineJoin` (`LineJoin`)

**Returns:** `void`

The line join style to be used by the current GraphicState.

### setMiterLimit

```java
void com.datalogics.PDFL.GraphicState.setMiterLimit(double miterLimit)
```

**Parameters**

- `miterLimit` (`double`)

**Returns:** `void`

The miter limit corresponding to the M operator.Default is 10.0.

### setRenderIntent

```java
void com.datalogics.PDFL.GraphicState.setRenderIntent(RenderIntent renderingIntent)
```

**Parameters**

- `renderingIntent` (`RenderIntent`)

**Returns:** `void`

A color rendering intent corresponding to the Intent key in the image dictionary. The default is RelColorimetric.

### setStrokeColor

```java
void com.datalogics.PDFL.GraphicState.setStrokeColor(Color strokecolor)
```

**Parameters**

- `strokecolor` ([`Color`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Color.md)): (DeviceGray, GrayScalevalue or strokecolor (DeviceRGB, Redvalue, Greenvalue, Bluevalue or strokecolor (DeviceCMYK, Cyanvalue, Magentavalue, Yellowvalue, Blackvalue

**Returns:** `void`

The stroke color of the GraphicState.

### setWidth

```java
void com.datalogics.PDFL.GraphicState.setWidth(double width)
```

**Parameters**

- `width` (`double`)

**Returns:** `void`

The width used for drawing by the current GraphicState.
