public class LayerContext
extends java.lang.Object
LayerContext
represents PDF Layer Context.
The LayerContext
class defines Usage Types for layer,
and other operations, such as reset, copy and merge layer context and so on.
It can be constructed by the following way:
Example:
LayerContext context = PDFDocument#createLayerContext(int);
PDFDocument
Modifier and Type | Field and Description |
---|---|
static int |
USAGETYPE_DESIGN
Use to represent a document designer's structural organization of artwork.
|
static int |
USAGETYPE_EXPORT
Use for exporting.
|
static int |
USAGETYPE_PRINT
Use for printing.
|
static int |
USAGETYPE_VIEW
Use for a viewer.
|
static int |
USAGETYPE_ZOOM
Use for zooming.
|
Modifier and Type | Method and Description |
---|---|
void |
copyStates(LayerContext srcLayerContext)
Copy state from source PDF layer context to current layer context.
|
PDFDocument |
getDocument()
Retrieve a PDF document which owns current PDF layer context.
|
long |
getHandle()
Get the handle of
LayerContext object. |
int |
getUsageType()
Get the usage type of current PDF layer context.
|
boolean |
isVisible(Layer layer)
Check whether a PDF layer is visible or not.
|
void |
mergeStates(LayerContext srcLayerContext)
Merge state from source PDF layer context to current layer context.
|
void |
release()
Release current PDF layer context.
|
void |
reset()
Reset current PDF layer context.
|
void |
setVisible(Layer layer,
boolean visible)
Change the visibility state of a PDF layer.
|
public static final int USAGETYPE_VIEW
public static final int USAGETYPE_DESIGN
public static final int USAGETYPE_PRINT
public static final int USAGETYPE_EXPORT
public static final int USAGETYPE_ZOOM
public long getHandle()
LayerContext
object.LayerContext
object.public void release() throws PDFException
PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public PDFDocument getDocument() throws PDFException
PDFDocument
object that receives a PDF document.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFDocument
public int getUsageType() throws PDFException
integer
value that indicates a usage type.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void reset() throws PDFException
PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public boolean isVisible(Layer layer) throws PDFException
layer
- A Layer
object which is a PDF layer. It shall be valid.boolean
value which indicates whether a layer is visible or not:
true
means visible, or false
means not.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
Layer
public void setVisible(Layer layer, boolean visible) throws PDFException
layer
- A Layer
object which is a PDF layer. It shall be valid.visible
- A boolean
value which represents the visibility state of PDF layer:
true
means visible, while false
means not.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
Layer
public void mergeStates(LayerContext srcLayerContext) throws PDFException
srcLayerContext
- A LayerContext
object which is a PDF layer context. It shall be valid.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
LayerContext
public void copyStates(LayerContext srcLayerContext) throws PDFException
srcLayerContext
- A LayerContext
object which is a PDF layer context. It shall be valid.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
LayerContext