# OptionalContentGroup Class

> A dictionary used to manage graphics images in a PDF.

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

```java
class OptionalContentGroup
```

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

## Description

A dictionary used to manage graphics images in a PDF. An Optional Content Group is a dictionary that represents a set of graphics images that users can turn on or off in a PDF document, making them visible or invisible.

In a PDF Viewer, Optional Content Groups are referred to as "Layers."

**Referenced by:** [`Document`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Document.md), [`OptionalContentConfig`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/OptionalContentConfig.md), [`OptionalContentContext`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/OptionalContentContext.md), [`OptionalContentGroup`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/OptionalContentGroup.md), [`OptionalContentGroupVector`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/OptionalContentGroupVector.md), [`OptionalContentMembershipDict`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/OptionalContentMembershipDict.md), [`OptionalContentOrderLeaf`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/OptionalContentOrderLeaf.md)

**Uses types:** [`Document`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Document.md), [`OptionalContentGroup`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/OptionalContentGroup.md), [`PDFDict`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/PDFDict.md)

## Constructors

### OptionalContentGroup

```java
com.datalogics.PDFL.OptionalContentGroup.OptionalContentGroup(Document doc, String name)
```

*constructor*

**Parameters**

- `doc` ([`Document`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Document.md)): The document that the new OptionalContentGroup will belong to.
- `name` (`String`): The name given to the new OptionalContentGroup.

Create a new OptionalContentGroup.

## Methods

### delete

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

*protected*

**Parameters**

- `disposing` (`Boolean`)

**Returns:** `synchronized void`

### delete

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

**Returns:** `synchronized void`

### equals

```java
boolean com.datalogics.PDFL.OptionalContentGroup.equals(Object rhs)
```

**Parameters**

- `rhs` (`Object`)

**Returns:** `boolean`

### finalize

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

*protected*

**Returns:** `void`

### getIntent

```java
java.util.List< String > com.datalogics.PDFL.OptionalContentGroup.getIntent()
```

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

An array containing intent strings.

Gets the intent list for an optional-content group. An intent is a string value broadly describing the intended use, either View or Design.

A group's content is considered to be optional (that is, the group's state is considered in its visibility) if any intent in its list matches an intent of the context. The intent list of the context is usually set from the intent list of the document configuration.

### getName

```java
String com.datalogics.PDFL.OptionalContentGroup.getName()
```

**Returns:** `String`

the name

Get the name of the optional content group

### getPDFDict

```java
PDFDict com.datalogics.PDFL.OptionalContentGroup.getPDFDict()
```

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

The underlying PDF dictionary for this OptionalContentGroup.

Retrieve the PDFObject representation of this object.

### setIntent

```java
void com.datalogics.PDFL.OptionalContentGroup.setIntent(java.util.List< String > intents)
```

**Parameters**

- `intents` (`java.util.List< String >`): An array of intent strings to assign to this group.

**Returns:** `void`

Sets the intent list for an optional-content group. An intent is a string value broadly describing the intended use, either View or Design.

A group's content is considered to be optional (that is, the group's state is considered in its visibility) if any intent in its list matches an intent of the context. The intent list of the context is usually set from the intent list of the document configuration.

### setName

```java
void com.datalogics.PDFL.OptionalContentGroup.setName(String name)
```

**Parameters**

- `name` (`String`): The new name for this OptionalContentGroup.

**Returns:** `void`

Set the name of the optional content group.

### toString

```java
String com.datalogics.PDFL.OptionalContentGroup.toString()
```

**Returns:** `String`

A string describing this OptionalContentGroup.

Returns a string representation of this OptionalContentGroup. The string includes the group's name and its intent list.
