Foxit PDF RDK

Public Member Functions | Static Public Attributes | List of all members
LayerContext Class Reference
Inheritance diagram for LayerContext:

## Public Member Functions
| constructor (document, usage_type)
| Constructor, based on a PDF document and specified layer usage type. More...
| CopyStates (source_context)
| Copy states from another layer context. More...
| GetDocument ()
| Get the related PDF document. More...
| GetUsageType ()
| Get the layer usage type for rendering. More...
| IsEmpty ()
| Check whether current object is empty or not. More...
| IsVisible (layer)
| Check if a specified layer node is visible in current layer context. More...
| MergeStates (source_context)
| Merge states from another layer context. More...
| Reset ()
| Reset current layer context, back to the initialized state. More...
| SetVisible (layer, is_visible)
| Set the visibility of a specified layer node in current layer context. More...
Public Member Functions inherited from NativeObjectWrapper
| constructor (r)
| GetPointerAsNumber ()

## Static Public Attributes
static | e_UsageDesign
| Use for representing a document designer's structural organization of artwork.
static | e_UsageExport
| Use for exporting.
static | e_UsagePrint
| Use for printing.
static | e_UsageView
| Enumeration for PDF layer usage type. More...
static | e_UsageZoom
| Use for zooming.

## Detailed Description

This class represents a layer context for rendering. If user wants to render layers, please construct a layer context object first and then set it to a Renderer object by function Renderer.SetLayerContext.

See also
  Renderer

Examples
  /Users/ec2-user/gitlab-runner/builds/E-xKdhDo/0/foxit/sdk/mobile/gsdk-doc-auto-build/harmony_nodejs/input/Index.js.

## Member Function Documentation

## ◆ constructor()

LayerContext.constructor | ( | document | ,
|  | usage_type |
| ) |  |

Constructor, based on a PDF document and specified layer usage type.

Parameters

  [in] | document | A valid PDF document object.
  [in] | usage_type | Layer usage type. Please refer to values starting from LayerContext.e_UsageView and this should be one of these values except LayerContext.e_UsageZoom.

Examples
  /Users/ec2-user/gitlab-runner/builds/E-xKdhDo/0/foxit/sdk/mobile/gsdk-doc-auto-build/harmony_nodejs/input/Index.js.

## ◆ CopyStates()

LayerContext.CopyStates | ( | source_context |  | ) |

Copy states from another layer context.

Parameters

  [in] | source_context | The source layer context, whose state will be copied to current layer context.

Returns
  true means success, while false means failure.

Examples
  /Users/ec2-user/gitlab-runner/builds/E-xKdhDo/0/foxit/sdk/mobile/gsdk-doc-auto-build/harmony_nodejs/input/Index.js.

## ◆ GetDocument()

LayerContext.GetDocument | ( |  | ) |

Get the related PDF document.

Returns
  The related PDF document object.

Examples
  /Users/ec2-user/gitlab-runner/builds/E-xKdhDo/0/foxit/sdk/mobile/gsdk-doc-auto-build/harmony_nodejs/input/Index.js.

## ◆ GetUsageType()

LayerContext.GetUsageType | ( |  | ) |

Get the layer usage type for rendering.

Returns
  Layer usage type. Please refer to values starting from LayerContext.e_UsageView and this would be one of these values except LayerContext.e_UsageZoom.

Examples
  /Users/ec2-user/gitlab-runner/builds/E-xKdhDo/0/foxit/sdk/mobile/gsdk-doc-auto-build/harmony_nodejs/input/Index.js.

## ◆ IsEmpty()

LayerContext.IsEmpty | ( |  | ) |

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
  true means current object is empty, while false means not.

Examples
  /Users/ec2-user/gitlab-runner/builds/E-xKdhDo/0/foxit/sdk/mobile/gsdk-doc-auto-build/harmony_nodejs/input/Index.js.

## ◆ IsVisible()

LayerContext.IsVisible | ( | layer |  | ) |

Check if a specified layer node is visible in current layer context.

Parameters

  [in] | layer | A layer node. It should belong to the same PDF document which is related to current layer context.

Returns
  true means the layer node is visible, while false means the layer node is invisible.

Examples
  /Users/ec2-user/gitlab-runner/builds/E-xKdhDo/0/foxit/sdk/mobile/gsdk-doc-auto-build/harmony_nodejs/input/Index.js.

## ◆ MergeStates()

LayerContext.MergeStates | ( | source_context |  | ) |

Merge states from another layer context.

Parameters

  [in] | source_context | The source layer context, whose state will be merged to current layer context.

Returns
  true means success, while false means failure.

Examples
  /Users/ec2-user/gitlab-runner/builds/E-xKdhDo/0/foxit/sdk/mobile/gsdk-doc-auto-build/harmony_nodejs/input/Index.js.

## ◆ Reset()

LayerContext.Reset | ( |  | ) |

Reset current layer context, back to the initialized state.

Returns
  true means success, while false means failure.

Examples
  /Users/ec2-user/gitlab-runner/builds/E-xKdhDo/0/foxit/sdk/mobile/gsdk-doc-auto-build/harmony_nodejs/input/Index.js.

## ◆ SetVisible()

LayerContext.SetVisible | ( | layer | ,
|  | is_visible |
| ) |  |

Set the visibility of a specified layer node in current layer context.

Parameters

  [in] | layer | A layer node. It should belong to the same PDF document which is related to current layer context.
  [in] | is_visible | true means visible, and false means invisible.

Returns
  true means the layer node is visible, while false means the layer node is invisible.

Examples
  /Users/ec2-user/gitlab-runner/builds/E-xKdhDo/0/foxit/sdk/mobile/gsdk-doc-auto-build/harmony_nodejs/input/Index.js.

## Member Data Documentation

## ◆ e_UsageView

LayerContext.e_UsageView
| static

Enumeration for PDF layer usage type.

Values of this enumeration should be used alone.

Use for a viewer.

Examples
  /Users/ec2-user/gitlab-runner/builds/E-xKdhDo/0/foxit/sdk/mobile/gsdk-doc-auto-build/harmony_nodejs/input/Index.js.