Foxit PDF SDK
com.foxit.sdk.pdf.LayerContext Class Reference
Inheritance diagram for com.foxit.sdk.pdf.LayerContext:
com.foxit.sdk.common.Base

Public Member Functions

 LayerContext (LayerContext other)
 Constructor, with another layer context object.
More...
 
 LayerContext (PDFDoc document, int usage_type) throws com.foxit.sdk.PDFException
 Constructor, based on a PDF document and specified layer usage type.
More...
 
boolean copyStates (LayerContext source_context) throws com.foxit.sdk.PDFException
 Copy states from another layer context.
More...
 
synchronized void delete ()
 Clean up related resources immediately. More...
 
PDFDoc getDocument () throws com.foxit.sdk.PDFException
 Get the related PDF document.
More...
 
int getUsageType () throws com.foxit.sdk.PDFException
 Get the layer usage type for rendering.
More...
 
boolean isEmpty ()
 Check whether current object is empty or not.
More...
 
boolean isVisible (LayerNode layer) throws com.foxit.sdk.PDFException
 Check if a specified layer node is visible in current layer context.
More...
 
boolean mergeStates (LayerContext source_context) throws com.foxit.sdk.PDFException
 Merge states from another layer context.
More...
 
boolean reset () throws com.foxit.sdk.PDFException
 Reset current layer context, back to the initialized state.
More...
 
boolean setVisible (LayerNode layer, boolean is_visible) throws com.foxit.sdk.PDFException
 Set the visibility of a specified layer node in current layer context.
More...
 

Static Public Attributes

static final int e_UsageDesign = 0x0001
 Use for representing a document designer's structural organization of artwork.

 
static final int e_UsageExport = 0x0003
 Use for exporting.

 
static final int e_UsagePrint = 0x0002
 Use for printing.

 
static final int e_UsageView = 0x0000
 Use for a viewer.

 
static final int e_UsageZoom = 0x0004
 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 com.foxit.sdk.common.Renderer object by function common.Renderer.setLayerContext .

See also
com.foxit.sdk.common.Renderer

Constructor & Destructor Documentation

◆ LayerContext() [1/2]

com.foxit.sdk.pdf.LayerContext.LayerContext ( PDFDoc  document,
int  usage_type 
) throws com.foxit.sdk.PDFException

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

Parameters
[in]documentA valid PDF document object.
[in]usage_typeLayer usage type. Please refer to values starting from com.foxit.sdk.pdf.LayerContext.e_UsageView and this should be one of these values except com.foxit.sdk.pdf.LayerContext.e_UsageZoom .

◆ LayerContext() [2/2]

com.foxit.sdk.pdf.LayerContext.LayerContext ( LayerContext  other)

Constructor, with another layer context object.

Parameters
[in]otherAnother layer context object.

Member Function Documentation

◆ copyStates()

boolean com.foxit.sdk.pdf.LayerContext.copyStates ( LayerContext  source_context) throws com.foxit.sdk.PDFException

Copy states from another layer context.

Parameters
[in]source_contextThe source layer context, whose state will be copied to current layer context.
Returns
true means success, while false means failure.

◆ delete()

synchronized void com.foxit.sdk.pdf.LayerContext.delete ( )

Clean up related resources immediately.

Returns
None.
Note
Once this function is called, current object cannot be used anymore.

Reimplemented from com.foxit.sdk.common.Base.

◆ getDocument()

PDFDoc com.foxit.sdk.pdf.LayerContext.getDocument ( ) throws com.foxit.sdk.PDFException

Get the related PDF document.

Returns
The related PDF document object.

◆ getUsageType()

int com.foxit.sdk.pdf.LayerContext.getUsageType ( ) throws com.foxit.sdk.PDFException

Get the layer usage type for rendering.

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

◆ isEmpty()

boolean com.foxit.sdk.pdf.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.

◆ isVisible()

boolean com.foxit.sdk.pdf.LayerContext.isVisible ( LayerNode  layer) throws com.foxit.sdk.PDFException

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

Parameters
[in]layerA 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.

◆ mergeStates()

boolean com.foxit.sdk.pdf.LayerContext.mergeStates ( LayerContext  source_context) throws com.foxit.sdk.PDFException

Merge states from another layer context.

Parameters
[in]source_contextThe source layer context, whose state will be merged to current layer context.
Returns
true means success, while false means failure.

◆ reset()

boolean com.foxit.sdk.pdf.LayerContext.reset ( ) throws com.foxit.sdk.PDFException

Reset current layer context, back to the initialized state.

Returns
true means success, while false means failure.

◆ setVisible()

boolean com.foxit.sdk.pdf.LayerContext.setVisible ( LayerNode  layer,
boolean  is_visible 
) throws com.foxit.sdk.PDFException

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

Parameters
[in]layerA layer node. It should belong to the same PDF document which is related to current layer context.
[in]is_visibletrue means visible, and false means invisible.
Returns
true means the layer node is visible, while false means the layer node is invisible.