Package org.faceless.pdf2
Class OptionalContentDescriptor
- java.lang.Object
-
- org.faceless.pdf2.OptionalContentDescriptor
-
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
OptionalContentLayer
public class OptionalContentDescriptor extends Object
An OptionalContentDescriptor is either an
OptionalContentLayeror a logical expression containing one or two OptionalContentDescriptors.Here's an example showing how to make a canvas visible when either the "interior" or "exterior" layers are selected as enabled in the viewer.
OptionalContentLayer interior = new OptionalContentLayer("interior"); OptionalContentLayer exterior = new OptionalContentLayer("exterior"); OptionalContentDescriptor or = OptionalContentDescriptor.or(interior, exterior); pdfcanvas.setOptionalContentDescriptor(or); pdf.getOptionalContentLayers().add(interior); pdf.getOptionalContentLayers().add(exterior);- Since:
- 2.23.5
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OptionalContentDescriptorand(OptionalContentDescriptor a, OptionalContentDescriptor b)Create a Descriptor which will enable the canvas with BOTH descriptors A and B are enabledprotected Objectclone()StringgetName()Return the "name" of this OptionalContentDescriptor.booleanisEnabled()Return true if this Optional Content Descriptor is enabled by default.static OptionalContentDescriptornot(OptionalContentDescriptor a)Create a Descriptor which will enable the canvas when descriptor a is NOT enabled.static OptionalContentDescriptoror(OptionalContentDescriptor a, OptionalContentDescriptor b)Create a Descriptor which will enable the canvas with EITHER of descriptors A and B are enabledStringtoString()
-
-
-
Method Detail
-
isEnabled
public boolean isEnabled()
Return true if this Optional Content Descriptor is enabled by default. For objects created withand(org.faceless.pdf2.OptionalContentDescriptor, org.faceless.pdf2.OptionalContentDescriptor),or(org.faceless.pdf2.OptionalContentDescriptor, org.faceless.pdf2.OptionalContentDescriptor)ornot(org.faceless.pdf2.OptionalContentDescriptor), the value is derived from its children.- Since:
- 2.24.3
-
getName
public String getName()
Return the "name" of this OptionalContentDescriptor. For objects created withand(org.faceless.pdf2.OptionalContentDescriptor, org.faceless.pdf2.OptionalContentDescriptor),or(org.faceless.pdf2.OptionalContentDescriptor, org.faceless.pdf2.OptionalContentDescriptor)ornot(org.faceless.pdf2.OptionalContentDescriptor), the value is derived from its children.- Since:
- 2.24.3
-
toString
public String toString()
-
and
public static OptionalContentDescriptor and(OptionalContentDescriptor a, OptionalContentDescriptor b)
Create a Descriptor which will enable the canvas with BOTH descriptors A and B are enabled- Parameters:
a- the first descriptorb- the first descriptor
-
or
public static OptionalContentDescriptor or(OptionalContentDescriptor a, OptionalContentDescriptor b)
Create a Descriptor which will enable the canvas with EITHER of descriptors A and B are enabled- Parameters:
a- the first descriptorb- the first descriptor
-
not
public static OptionalContentDescriptor not(OptionalContentDescriptor a)
Create a Descriptor which will enable the canvas when descriptor a is NOT enabled.- Parameters:
a- the descriptor to invert
-
-