[]
        
(Showing Draft Content)

GrapeCity.Documents.Pdf.Layers.ViewState

ViewState Class

Represents the view state of a PDF document.

The presentation of a PDF document may depend on the context that is determined by the current environment and is not persisted in the PDF itself. This includes:

  • The transient state of optional content (e.g. the user may have turned a layer's visibility on or off).
  • The current operation (e.g. view or print).
This class is used to specify the target context for operations that work with document content, so that only the relevant content is processed. Note that an instance of this class is not automatically updated if the document content (e.g. layers) changes. Use the Reset() method to reset the view state to its initial state.
Inheritance
ViewState
Namespace: GrapeCity.Documents.Pdf.Layers
Assembly: DS.Documents.Pdf.dll
Syntax
public class ViewState
Public Class ViewState

Constructors

Name Description
ViewState(GcPdfDocument, bool)

Initializes a new instance of the ViewState class.

Fields

Name Description
Doc

The GcPdfDocument for which this ViewState was created.

Properties

Name Description
CurrentConfiguration

Gets the OptionalContentConfiguration specified in the last ApplyConfiguration(OptionalContentConfiguration) method call.

IgnoreLayersState

Gets or sets a value indicating whether all layers' state should be ignored and all layers should be considered visible.

Mode

Gets or sets the document view mode.

Zoom

Gets or sets the document zoom value (1 is actual size, no zoom).

Methods

Name Description
ApplyConfiguration(OptionalContentConfiguration)

Applies the specified configuration to this view state.

GetLayerUIState(OptionalContentGroup)

Gets the visibility state of an optional content group (layer) in the context of an end-user UI The return value is interpreted as follows:

  • true: the user explicitly made layer visible.
  • false: the user explicitly made layer hidden.
  • null: the user did not change the visibility of layer.
GetLayerUIState(string)

Gets the visibility state of an optional content group (layer) in the context of an end-user UI The return value is interpreted as follows:

  • true: the user explicitly made the layer visible.
  • false: the user explicitly made the layer hidden.
  • null: the user did not change the visibility of the layer.
IsLayerActive(object)

Checks whether a layer is active in the view mode specified by the Mode property. The target layer can be specified as an OptionalContentGroup, an OptionalContentMembership or a string representing the name of the layer.

IsLayerActive(object, ViewMode)

Checks whether a layer is active in a specified view mode. The target layer can be specified as an OptionalContentGroup, an OptionalContentMembership or a string representing the name of the layer.

IsLayerExportable(object)

Checks whether a layer is visible when the document is exported. The target layer can be specified as an OptionalContentGroup, an OptionalContentMembership or a string representing the name of the layer.

IsLayerPrintable(object)

Checks whether a layer is visible when the document is printed. The target layer can be specified as an OptionalContentGroup, an OptionalContentMembership or a string representing the name of the layer.

IsLayerVisible(object)

Checks whether a layer is visible when the document is viewed. The target layer can be specified as an OptionalContentGroup, an OptionalContentMembership or a string representing the name of the layer.

Reset()

Resets this ViewState to its initial state.

SetLayerUIState(OptionalContentGroup, bool?)

Sets the visibility of an optional content group (layer) in the context of an end-user UI. The state is interpreted as follows:

  • true: the user explicitly made layer visible.
  • false: the user explicitly made layer hidden.
  • null: the user did not change the visibility of layer.
SetLayerUIState(string, bool?)

Sets the visibility of an optional content group (layer) in the context of an end-user UI. The state is interpreted as follows:

  • true: the user explicitly made layerName visible.
  • false: the user explicitly made layerName hidden.
  • null: the user did not change the visibility of layerName.
SetLayersUIState(bool?, params object[])

Sets the visibility of one or more layers in the context of an end-user UI. The layers array can contain layer names (strings) or OptionalContentGroup references. The state is interpreted as follows:

  • true: the user explicitly made the layers visible.
  • false: the user explicitly made the layers hidden.
  • null: the user did not change the visibility of the layers.
SetLayersUIStateExcept(bool?, params object[])

Sets the visibility of all layers except those listed in the layers array, in the context of an end-user UI. The layers array can contain layer names (strings) or OptionalContentGroup references. The state is interpreted as follows:

  • true: the user explicitly made all layers (except the specified ones) visible.
  • false: the user explicitly made all layers (except the specified ones) hidden.
  • null: the user did not change the visibility of the layers.