Class OptionalContentDescriptor

  • All Implemented Interfaces:
    Cloneable
    Direct Known Subclasses:
    OptionalContentLayer

    public class OptionalContentDescriptor
    extends Object

    An OptionalContentDescriptor is either an OptionalContentLayer or 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