[]
        
(Showing Draft Content)

GrapeCity.Documents.Pdf.Layers.OptionalContentProperties

Class OptionalContentProperties

Namespace
GrapeCity.Documents.Pdf.Layers
Assembly
GcDocs.Pdf.dll

Represents the Optional Content Properties PDF dictionary that can be specified in the document catalog.

public class OptionalContentProperties : PdfDictWrapper, IPdfDict
Inheritance
object
OptionalContentProperties
Implements
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Extension Methods

Properties

Configs

Gets the collection of alternate optional content configurations.

public OptionalContentConfigurationCollection Configs { get; }

Property Value

OptionalContentConfigurationCollection

DefaultConfig

Gets the default optional content configuration.

public OptionalContentConfiguration DefaultConfig { get; }

Property Value

OptionalContentConfiguration

Doc

Gets the GcPdfDocument object that owns this object.

public GcPdfDocument Doc { get; }

Property Value

GcPdfDocument

Groups

Gets the collection of optional content groups.

public OptionalContentGroupCollection Groups { get; }

Property Value

OptionalContentGroupCollection

HasConfigs

Gets a value indicating whether the Configs collection is not empty.

public bool HasConfigs { get; }

Property Value

bool

HasDefaultConfig

Gets a value indicating whether this OptionalContentProperties has DefaultConfig property.

public bool HasDefaultConfig { get; }

Property Value

bool

HasGroups

Gets a value indicating whether the Groups collection is not empty.

public bool HasGroups { get; }

Property Value

bool

Methods

AddLayer(string)

Adds a layer with a specified name.

public OptionalContentGroup AddLayer(string name)

Parameters

name string

The layer name.

Returns

OptionalContentGroup

The newly created OptionalContentGroup object that defines the new layer.

Clear()

Clears the content of the current object.

public void Clear()

GetLayer(string)

Returns the OptionalContentGroup by its name.

public OptionalContentGroup GetLayer(string layerName)

Parameters

layerName string

The layer name.

Returns

OptionalContentGroup

The OptionalContentGroup object or null if not found.

GetLayerDefaultState(OptionalContentGroup)

Returns a value indicating whether a layer is ON by default.

public bool GetLayerDefaultState(OptionalContentGroup layer)

Parameters

layer OptionalContentGroup

The OptionalContentGroup object that specifies the layer.

Returns

bool

A value indicating whether the layer is ON by default.

GetLayerDefaultState(string)

Returns a value indicating whether a layer is ON by default. Throws an exception if the layer with the specified name does not exist.

public bool GetLayerDefaultState(string name)

Parameters

name string

The name of the layer.

Returns

bool

A value indicating whether the layer is ON by default.

GetLayerExportState(OptionalContentGroup)

Returns the export state of a layer.

public LayerExportState GetLayerExportState(OptionalContentGroup layer)

Parameters

layer OptionalContentGroup

The OptionalContentGroup object that specifies the layer.

Returns

LayerExportState

The export state of the layer.

GetLayerExportState(string)

Returns the export state of a layer. Throws an exception if the layer with the specified name does not exist.

public LayerExportState GetLayerExportState(string name)

Parameters

name string

The name of the layer.

Returns

LayerExportState

The export state of the layer.

GetLayerInitialViewState(OptionalContentGroup)

Returns the layer initial view state of a layer.

public LayerInitialViewState GetLayerInitialViewState(OptionalContentGroup layer)

Parameters

layer OptionalContentGroup

The OptionalContentGroup object that specifies the layer.

Returns

LayerInitialViewState

The initial view state of the layer.

GetLayerInitialViewState(string)

Returns the layer initial view state of a layer. Throws an exception if the layer with the specified name does not exist.

public LayerInitialViewState GetLayerInitialViewState(string name)

Parameters

name string

The name of the layer.

Returns

LayerInitialViewState

The initial view state of the layer.

GetLayerLocked(OptionalContentGroup)

Returns a value indicating whether a layer is locked.

public bool GetLayerLocked(OptionalContentGroup layer)

Parameters

layer OptionalContentGroup

The OptionalContentGroup object defining the layer.

Returns

bool

true if layer is locked, false otherwise.

GetLayerLocked(string)

Returns a value indicating whether a layer is locked. Throws an exception if the layer with the specified name does not exist.

public bool GetLayerLocked(string name)

Parameters

name string

The name of the layer.

Returns

bool

true if layer is locked, false otherwise.

GetLayerPrintState(OptionalContentGroup)

Returns the print state of a layer.

public LayerPrintState GetLayerPrintState(OptionalContentGroup layer)

Parameters

layer OptionalContentGroup

The OptionalContentGroup object that specifies the layer.

Returns

LayerPrintState

The print state of the layer.

GetLayerPrintState(string)

Returns the print state of a layer. Throws an exception if the layer with the specified name does not exist.

public LayerPrintState GetLayerPrintState(string name)

Parameters

name string

The name of the layer.

Returns

LayerPrintState

The print state of the layer.

RemoveLayer(OptionalContentGroup)

Removes a specified layer. Note that this method does not remove the content associated with the layer. For content removal, see RemoveLayers(bool, params OptionalContentGroup[]).

public void RemoveLayer(OptionalContentGroup layer)

Parameters

layer OptionalContentGroup

The OptionalContentGroup object that specifies the layer to remove.

RemoveLayer(string)

Removes a layer with a specified name. Throws an exception if the layer with the specified name does not exist. Note that this method does not remove the content associated with the layer. For content removal, see RemoveLayers(bool, params OptionalContentGroup[]).

public void RemoveLayer(string name)

Parameters

name string

The name of the layer to remove.

RemoveLayers(bool, params OptionalContentGroup[])

Removes specified layers, optionally removing content associated with those layers.

public void RemoveLayers(bool removeContent, params OptionalContentGroup[] layers)

Parameters

removeContent bool

Indicates whether to remove content associated with the specified layers.

layers OptionalContentGroup[]

An array of OptionalContentGroup objects that specify the layers to be removed.

SetLayerDefaultState(OptionalContentGroup, bool)

Sets the default state of a layer.

public void SetLayerDefaultState(OptionalContentGroup layer, bool on)

Parameters

layer OptionalContentGroup

The OptionalContentGroup object that specifies the layer.

on bool

Indicates whether the layer is ON (visible) by default.

SetLayerDefaultState(string, bool)

Sets the default state of a layer. Throws an exception if the layer with the specified name does not exist.

public void SetLayerDefaultState(string name, bool on)

Parameters

name string

The name of the layer.

on bool

Indicates whether the layer is ON (visible) by default.

SetLayerExportState(OptionalContentGroup, LayerExportState)

Sets the export state of a layer.

public void SetLayerExportState(OptionalContentGroup layer, LayerExportState value)

Parameters

layer OptionalContentGroup

The OptionalContentGroup object that specifies the layer.

value LayerExportState

The export state.

SetLayerExportState(string, LayerExportState)

Sets the export state of a layer. Throws an exception if the layer with the specified name does not exist.

public void SetLayerExportState(string name, LayerExportState value)

Parameters

name string

The name of the layer.

value LayerExportState

The export state.

SetLayerInitialViewState(OptionalContentGroup, LayerInitialViewState)

Sets the initial view state of a layer.

public void SetLayerInitialViewState(OptionalContentGroup layer, LayerInitialViewState value)

Parameters

layer OptionalContentGroup

The OptionalContentGroup object that specifies the layer.

value LayerInitialViewState

The initial view state.

SetLayerInitialViewState(string, LayerInitialViewState)

Sets the initial view state of a layer. Throws an exception if the layer with the specified name does not exist.

public void SetLayerInitialViewState(string name, LayerInitialViewState value)

Parameters

name string

The name of the layer.

value LayerInitialViewState

The initial view state.

SetLayerLocked(OptionalContentGroup, bool)

Sets the locked state of a layer.

public void SetLayerLocked(OptionalContentGroup layer, bool locked)

Parameters

layer OptionalContentGroup

The OptionalContentGroup object that specifies the layer.

locked bool

Indicates whether the layer is locked.

SetLayerLocked(string, bool)

Sets the locked state of a layer. Throws an exception if the layer with the specified name does not exist.

public void SetLayerLocked(string name, bool value)

Parameters

name string

The name of the layer.

value bool

Indicates whether the layer is locked.

SetLayerPrintState(OptionalContentGroup, LayerPrintState)

Sets the print state of a layer.

public void SetLayerPrintState(OptionalContentGroup layer, LayerPrintState value)

Parameters

layer OptionalContentGroup

The OptionalContentGroup object that specifies the layer.

value LayerPrintState

The print state of the layer.

SetLayerPrintState(string, LayerPrintState)

Sets the print state of a layer. Throws an exception if the layer with the specified name does not exist.

public void SetLayerPrintState(string name, LayerPrintState value)

Parameters

name string

The name of the layer.

value LayerPrintState

The print state of the layer.