Class PdfLayerMembership
java.lang.Object
com.itextpdf.text.pdf.PdfObject
com.itextpdf.text.pdf.PdfDictionary
com.itextpdf.text.pdf.PdfLayerMembership
- All Implemented Interfaces:
PdfOCG, Serializable
Content typically belongs to a single optional content group,
and is visible when the group is ON and invisible when it is OFF. To express more
complex visibility policies, content should not declare itself to belong to an optional
content group directly, but rather to an optional content membership dictionary
represented by this class.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PdfNameVisible only if all of the entries are OFF.static final PdfNameVisible only if all of the entries are ON.static final PdfNameVisible if any of the entries are OFF.static final PdfNameVisible if any of the entries are ON.(package private) PdfArray(package private) PdfIndirectReference -
Constructor Summary
ConstructorsConstructorDescriptionPdfLayerMembership(PdfWriter writer) Creates a new, empty, membership layer. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new member to the layer.Gets the member layers.Gets the dictionary representing the membership layer.getRef()Gets thePdfIndirectReferencethat represents this membership layer.voidSets the visibility expression for content belonging to this membership dictionary.voidsetVisibilityPolicy(PdfName type) Sets the visibility policy for content belonging to this membership dictionary.Methods inherited from class PdfDictionary
checkType, clear, contains, get, getAsArray, getAsBoolean, getAsDict, getAsIndirectObject, getAsName, getAsNumber, getAsStream, getAsString, getDirectObject, getKeys, isCatalog, isFont, isOutlineTree, isPage, isPages, merge, mergeDifferent, put, putAll, putEx, remove, size, toPdf, toStringMethods inherited from class PdfObject
canBeInObjStm, getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, type
-
Field Details
-
ALLON
Visible only if all of the entries are ON. -
ANYON
Visible if any of the entries are ON. -
ANYOFF
Visible if any of the entries are OFF. -
ALLOFF
Visible only if all of the entries are OFF. -
ref
-
members
PdfArray members -
layers
-
-
Constructor Details
-
PdfLayerMembership
Creates a new, empty, membership layer.- Parameters:
writer- the writer
-
-
Method Details
-
getRef
Gets thePdfIndirectReferencethat represents this membership layer. -
addMember
Adds a new member to the layer.- Parameters:
layer- the new member to the layer
-
getLayers
-
setVisibilityPolicy
Sets the visibility policy for content belonging to this membership dictionary. Possible values are ALLON, ANYON, ANYOFF and ALLOFF. The default value is ANYON.- Parameters:
type- the visibility policy
-
setVisibilityExpression
Sets the visibility expression for content belonging to this membership dictionary.- Parameters:
ve- A (nested) array of which the first value is /And, /Or, or /Not followed by a series of indirect references to OCGs or other visibility expressions.- Since:
- 5.0.2
-
getPdfObject
Gets the dictionary representing the membership layer. It just returnsthis.- Specified by:
getPdfObjectin interfacePdfOCG- Returns:
- the dictionary representing the layer
-