public class PdfOCProperties extends PdfObjectWrapper<PdfDictionary>
To be able to be wrapped with this PdfObjectWrapper
the PdfObject
must be indirect.
Constructor and Description |
---|
PdfOCProperties(PdfDictionary ocPropertiesDict)
Creates a new PdfOCProperties instance by the dictionary it represents, the dictionary must be an indirect object.
|
PdfOCProperties(PdfDocument document)
Creates a new PdfOCProperties instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addOCGRadioGroup(List<PdfLayer> group)
Use this method to set a collection of optional content groups whose states are intended to follow a "radio button" paradigm.
|
PdfObject |
fillDictionary()
Fills the underlying PdfDictionary object with the current layers and their settings.
|
PdfObject |
fillDictionary(boolean removeNonDocumentOcgs)
Fills the underlying PdfDictionary object with the current layers and their settings.
|
void |
flush() |
protected PdfDocument |
getDocument()
Gets the PdfDocument that owns that OCProperties.
|
List<PdfLayer> |
getLayers()
Gets the list of all the layers currently registered in the OCProperties.
|
protected boolean |
isWrappedObjectMustBeIndirect()
Defines if the object behind this wrapper must be an indirect object in the resultant document.
|
protected void |
registerLayer(PdfLayer layer)
This method registers a new layer in the OCProperties.
|
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
public PdfOCProperties(PdfDocument document)
document
- the document the optional content belongs to
public PdfOCProperties(PdfDictionary ocPropertiesDict)
ocPropertiesDict
- the dictionary of optional content properties, must have an indirect reference.
public void addOCGRadioGroup(List<PdfLayer> group)
group
- the radio group
public PdfObject fillDictionary()
public PdfObject fillDictionary(boolean removeNonDocumentOcgs)
removeNonDocumentOcgs
- the flag indicating whether it is necessary to delete OCGs not from the current document
public void flush()
flush
in class PdfObjectWrapper<PdfDictionary>
public List<PdfLayer> getLayers()
layers
currently registered in the OCProperties
protected boolean isWrappedObjectMustBeIndirect()
PdfObjectWrapper
isWrappedObjectMustBeIndirect
in class PdfObjectWrapper<PdfDictionary>
protected void registerLayer(PdfLayer layer)
layer
- the new layer
IllegalArgumentException
- if layer param is null
protected PdfDocument getDocument()
PdfDocument
that owns that OCProperties.
PdfDocument
that owns that OCProperties
Copyright © 1998–2023 iText Group NV. All rights reserved.