# GraphicState Class

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

- Product: Adobe PDF Library 18
- Language: Java
- Version: APDFL18.0.5PlusP2e
- HTML page: https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/GraphicState
- Version index: https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/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.5PlusP2e/class/Form.md), [`Image`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Image.md), [`Path`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Path.md), [`Shading`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Shading.md), [`Text`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Text.md), [`TextRun`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/TextRun.md)

**Uses types:** [`Color`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Color.md), [`ExtendedGraphicState`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/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.5PlusP2e/class/ExtendedGraphicState.md)

The ExtendedGraphicState, or null if none is set.

The ExtendedGraphicState associated with this GraphicState.

The ExtendedGraphicState can contain additional parameters such as transparency, blend mode, and overprint settings that are not part of the basic GraphicState.

### getFillColor

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

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

The current fill color.

The color used for filling operations in the current GraphicState.

### getLineCap

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

**Returns:** `LineCap`

The current line cap style.

The line cap style used by the current GraphicState, specifying the shape at the ends of open subpaths when stroked.

### getLineFlatness

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

**Returns:** `double`

The current line flatness value.

The line flatness tolerance in the current GraphicState, corresponding to the i operator. Default is 1.0.

Flatness controls the maximum distance (in device pixels) between a curve and the flattened line segments that approximate it.

### getLineJoin

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

**Returns:** `LineJoin`

The current line join style.

The line join style used by the current GraphicState, specifying the shape at the corners where consecutive segments of a path connect at an angle.

### getMiterLimit

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

**Returns:** `double`

The current miter limit.

The miter limit for line joins in the current GraphicState, corresponding to the M operator. Default is 10.0.

When two line segments meet at a sharp angle and mitered joins have been specified, the miter limit controls when the join is beveled instead.

### getRenderIntent

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

**Returns:** `RenderIntent`

The current rendering intent.

The color rendering intent for the current GraphicState, 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.5PlusP2e/class/Color.md)

The current stroke color.

The color used for stroking operations in the current GraphicState.

### getWidth

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

**Returns:** `double`

The current line width.

The line width used for stroking operations by the current GraphicState, in user space units.

### 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.5PlusP2e/class/ExtendedGraphicState.md)): The new ExtendedGraphicState, or null to remove it.

**Returns:** `void`

The ExtendedGraphicState associated with this GraphicState.

The ExtendedGraphicState can contain additional parameters such as transparency, blend mode, and overprint settings that are not part of the basic GraphicState.

### setFillColor

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

**Parameters**

- `fillcolor` ([`Color`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Color.md)): The new fill color.

**Returns:** `void`

The color used for filling operations in the current GraphicState.

The color may be specified in DeviceGray, DeviceRGB, or DeviceCMYK color spaces.

### setLineCap

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

**Parameters**

- `LineCap` (`LineCap`): The new line cap style.

**Returns:** `void`

The line cap style used by the current GraphicState, specifying the shape at the ends of open subpaths when stroked.

### setLineFlatness

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

**Parameters**

- `flatness` (`double`): The new flatness value.

**Returns:** `void`

The line flatness tolerance in the current GraphicState, corresponding to the i operator. Default is 1.0.

### setLineJoin

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

**Parameters**

- `LineJoin` (`LineJoin`): The new line join style.

**Returns:** `void`

The line join style to be used by the current GraphicState, specifying the shape at the corners where consecutive segments of a path connect at an angle.

### setMiterLimit

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

**Parameters**

- `miterLimit` (`double`): The new miter limit value.

**Returns:** `void`

The miter limit for line joins in the current GraphicState, corresponding to the M operator. Default is 10.0.

### setRenderIntent

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

**Parameters**

- `renderingIntent` (`RenderIntent`): The new rendering intent.

**Returns:** `void`

The color rendering intent for the current GraphicState, 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.5PlusP2e/class/Color.md)): The new stroke color.

**Returns:** `void`

The color used for stroking operations in the current GraphicState.

The color may be specified in DeviceGray, DeviceRGB, or DeviceCMYK color spaces.

### setWidth

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

**Parameters**

- `width` (`double`): The new line width.

**Returns:** `void`

The line width used for stroking operations by the current GraphicState, in user space units.
