class HexaPDF:: Type:: OptionalContentProperties
Parent | HexaPDF::Dictionary |
---|
Represents an optional content properties dictionary.
This dictionary is the value of the /OCProperties key in the document catalog and needs to exist for optional content to be usable by a PDF processor.
In HexaPDF
it provides the main entry point for working with optional content.
See: PDF2.0 s8.11.4.2
Field Definitions
Name | Type/Allowed Values | Required | Default Value |
---|---|---|---|
OCGs | HexaPDF::PDFArray or Array | true | [] |
D | HexaPDF::Type::OptionalContentConfiguration or Hash | true | nil |
Configs | HexaPDF::PDFArray or Array | false | nil |
Public Instance Methods
Adds the given optional content group to the list of known OCGs and returns it. If a string is provided, an optional content group with that name is created before adding it.
See: ocg
, OptionalContentGroup
Creates an optional content membership dictionary containing the given optional content group(s).
The optional argument policy
specifies the visibility policy:
Returns the default optional content configuration dictionary if no argument is given. Otherwise sets the the default optional content configuration to the given hash value.
The default configuration defines the initial state of the optional content groups and how those states may be changed by a PDF processor.
Example:
optional_content.default_configuration(
Name: 'My Configuration',
OFF: [ocg1],
Order: [ocg_all, [ocg1, ocg2, ocg3]]
)
Returns the first found optional content group with the given name
.
If no optional content group with the given name
exists but the optional argument create
is true
, a new OCG with the given name
is created and returned. Otherwise nil
is returned.
See: add_ocg
Returns the list of known optional content group objects, with duplicates removed.