Top Description Inners Fields Constructors Methods
org.apache.pdfbox.pdmodel.graphics.optionalcontent

public Class PDOptionalContentGroup

extends PDPropertyList
Class Inheritance
Imports
org.apache.pdfbox.cos.COSDictionary, .COSName, org.apache.pdfbox.pdmodel.documentinterchange.markedcontent.PDPropertyList, org.apache.pdfbox.rendering.RenderDestination

An optional content group (OCG).

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
PDOptionalContentGroup.RenderState

Enumeration for the renderState dictionary entry on the "Export", "View" and "Print" dictionary.

Field Summary

Inherited from org.apache.pdfbox.pdmodel.documentinterchange.markedcontent.PDPropertyList:
dict

Constructor Summary

AccessConstructor and Description
public
PDOptionalContentGroup(String
the name of the content group
name
)

Creates a new optional content group (OCG).

public
PDOptionalContentGroup(COSDictionary
the dictionary
dict
)

Creates a new instance based on a given COSDictionary.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the name
getName
()

Returns the name of the optional content group.

public PDOptionalContentGroup.RenderState

Returns:

state or null if undefined
getRenderState
(RenderDestination
to be rendered
destination
)

public final void
setName(String
the name
name
)

Sets the name of the optional content group.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.apache.pdfbox.pdmodel.documentinterchange.markedcontent.PDPropertyList:
creategetCOSObject

Constructor Detail

PDOptionalContentGroupback to summary
public PDOptionalContentGroup(String name)

Creates a new optional content group (OCG).

Parameters
name:String

the name of the content group

PDOptionalContentGroupback to summary
public PDOptionalContentGroup(COSDictionary dict)

Creates a new instance based on a given COSDictionary.

Parameters
dict:COSDictionary

the dictionary

Method Detail

getNameback to summary
public String getName()

Returns the name of the optional content group.

Returns:String

the name

getRenderStateback to summary
public PDOptionalContentGroup.RenderState getRenderState(RenderDestination destination)
Parameters
destination:RenderDestination

to be rendered

Returns:PDOptionalContentGroup.RenderState

state or null if undefined

setNameback to summary
public final void setName(String name)

Sets the name of the optional content group.

Parameters
name:String

the name

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
org.apache.pdfbox.pdmodel.graphics.optionalcontent back to summary

public final Enum PDOptionalContentGroup.RenderState

extends Enum<PDOptionalContentGroup.RenderState>
Class Inheritance

Enumeration for the renderState dictionary entry on the "Export", "View" and "Print" dictionary.

Field Summary

Modifier and TypeField and Description
private final COSName
public static final PDOptionalContentGroup.RenderState
OFF

The "OFF" value.

public static final PDOptionalContentGroup.RenderState
ON

The "ON" value.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public COSName

Returns:

the name of the state
getName
()

Returns the PDF name for the state.

public static PDOptionalContentGroup.RenderState
public static PDOptionalContentGroup.RenderState

Returns:

the state enum value
valueOf
(COSName
the state name
state
)

Returns the base state represented by the given COSName.

public static PDOptionalContentGroup.RenderState[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

nameback to summary
private final COSName name

Hides java.lang.Enum.name.

OFFback to summary
public static final PDOptionalContentGroup.RenderState OFF

The "OFF" value.

ONback to summary
public static final PDOptionalContentGroup.RenderState ON

The "ON" value.

Constructor Detail

RenderStateback to summary
private RenderState(COSName value)

Method Detail

getNameback to summary
public COSName getName()

Returns the PDF name for the state.

Returns:COSName

the name of the state

valueOfback to summary
public static PDOptionalContentGroup.RenderState valueOf(String name)
valueOfback to summary
public static PDOptionalContentGroup.RenderState valueOf(COSName state)

Returns the base state represented by the given COSName.

Parameters
state:COSName

the state name

Returns:PDOptionalContentGroup.RenderState

the state enum value

valuesback to summary
public static PDOptionalContentGroup.RenderState[] values()