public class Layer
extends java.lang.Object
Layer
represents a PDF layer.
The Layer
class defines methods to get properties of a layer.
It can be constructed by the following way:
Example:
Layer layer = LayerNode#getLayer();
LayerNode
Modifier and Type | Field and Description |
---|---|
static int |
USAGESTATE_OFF
The state is OFF.
|
static int |
USAGESTATE_ON
The state is ON.
|
static int |
USAGESTATE_UNCHANGED
The state is unchanged.
|
static int |
USAGESTATE_UNDEFINED
The state is undefined.
|
Modifier and Type | Method and Description |
---|---|
void |
addPageObject(PDFPage page,
PageObject pageObject)
Add a specified page object to current layer.
|
int |
getExportUsage()
Get layer usage state for exporting.
|
long |
getHandle()
Get the
Layer handle. |
java.lang.String |
getName()
Get the name of current PDF layer.
|
java.util.ArrayList<PageObject> |
getPageObjects(PDFPage page)
get page objects which is related with current layer.
|
PrintData |
getPrintData()
Get layer usage data for printing.
|
int |
getViewUsage()
Get layer usage state for viewing.
|
ZoomData |
getZoomData()
Get layer usage data for zooming.
|
boolean |
hasIntent(java.lang.String intent)
Check whether current PDF layer has a specific intent.
|
boolean |
isInPage(PDFPage page)
Check whether current PDF layer is in a given page or not.
|
void |
removePageObject(PageObject pageObject)
Remove a specified page object to current layer.
|
void |
removeUsage(int usage)
Remove a kind of usage property.
|
void |
setDefaultVisibleState(boolean visible)
Set default visible state to current layer
|
void |
setExportUsage(int exportUsage)
Set layer usage state for exporting.
|
void |
setName(java.lang.String name)
Set the name of current PDF layer.
|
void |
setPrintData(PrintData printData)
Set layer usage data for printing.
|
void |
setViewUsage(int viewUsage)
Set layer usage state for viewing.
|
void |
setZoomData(ZoomData zoomData)
Set layer usage data for zooming.
|
public static final int USAGESTATE_ON
public static final int USAGESTATE_OFF
public static final int USAGESTATE_UNCHANGED
public static final int USAGESTATE_UNDEFINED
public long getHandle()
Layer
handle.Layer
handle.public java.lang.String getName() throws PDFException
String
object that receives a layer name.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setName(java.lang.String name) throws PDFException
name
- A String
object that specifies value of name
property.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public boolean isInPage(PDFPage page) throws PDFException
page
- A PDFPage
object which is a PDF page. It shall be valid.boolean
value which indicates whether a layer is in a given page or not:
true
means in the page, while false
means not.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFPage
public boolean hasIntent(java.lang.String intent) throws PDFException
intent
- A String
object that specifies the intent name.
Currently, PDF defines two intent names:"View","Design".boolean
value which indicates whether a layer has a specific intent
true
means it has the intent, while false
means not.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public int getViewUsage() throws PDFException
USAGESTATE_XXX
and this should be one of these constants.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setViewUsage(int viewUsage) throws PDFException
viewUsage
- An integer
value to indicate export usage state. It
should be one of the followings:PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public int getExportUsage() throws PDFException
USAGESTATE_XXX
and this should be one of these constants.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setExportUsage(int exportUsage) throws PDFException
exportUsage
- An integer
value to indicate export usage state. It
should be one of the followings:PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public PrintData getPrintData() throws PDFException
PrintData
value which indicates print data.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setPrintData(PrintData printData) throws PDFException
printData
- A PrintData
value which indicates print data.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public ZoomData getZoomData() throws PDFException
ZoomData
value which indicates zoom data.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setZoomData(ZoomData zoomData) throws PDFException
zoomData
- A ZoomData
value which indicates print data.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public java.util.ArrayList<PageObject> getPageObjects(PDFPage page) throws PDFException
page
- a PDFPage
object which is a PDF page object.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void addPageObject(PDFPage page, PageObject pageObject) throws PDFException
page
- a PDFPage
object which is a PDF page object.
pageObject
a PageObject
would be added.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.public void removePageObject(PageObject pageObject) throws PDFException
pageObject
- a PageObject
would be removed.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.public void removeUsage(int usage) throws PDFException
usage
- An integer
value to indicate usage type. It
should be one of the followings:PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.public void setDefaultVisibleState(boolean visible) throws PDFException
visible
- A boolean
value that indicate the default status(true
for visible, false
for invisible).PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.