public class MarkedContent
extends java.lang.Object
MarkedContent
represents a marked content object.
Marked content is a part of page objects, and marked content object may be
nested one within another, so after adding or deleting an item from marked
content, applications should call the function
before saving a page to a
file or reloading a page, otherwise all changes on page objects will be lost.
PageObjects.generateContents()
It can be constructed by the following way:
Example:
PathObject pathObj = PathObject.create(page); MarkedContent mc = pathObj.getMarkedContent();
PathObject
,
PageObjects
Modifier and Type | Field and Description |
---|---|
static int |
PARAMTYPE_DIRECTDICT
Parameter type: a dictionary which may be written inline in the content stream as a direct
object.
|
static int |
PARAMTYPE_NONE
Parameter type: no parameter.
|
static int |
PARAMTYPE_PROPERTIESDICT
Parameter type: a dictionary which is defined by named resource in the "Properties"
sub-dictionary of the current resource dictionary.
|
Modifier and Type | Method and Description |
---|---|
void |
addItem(java.lang.String tagName,
int paramType,
java.lang.Object item)
Add a new marked content item to the current marked content object
associated with the current page object.
|
int |
countItems()
Get the count of marked content items in the marked content sequence.
|
void |
deleteItem(java.lang.String tagName)
Delete a specific marked content item from the current marked content
sequence.
|
int |
getItemType(java.lang.String tagName)
Get a parameter type of a specific marked content item in the current
marked content sequence.
|
java.lang.Object |
getItemValue(java.lang.String tagName)
Get a parameter value object of specific marked content item in the current
marked content sequence.
|
java.lang.String |
getTagName(int index)
Get the tag name of a specific marked content item in the current marked
content sequence.
|
boolean |
hasTag(java.lang.String tagName)
Check whether current marked content object has a specified marked
content item in the current marked content sequence.
|
public static final int PARAMTYPE_NONE
public static final int PARAMTYPE_PROPERTIESDICT
public static final int PARAMTYPE_DIRECTDICT
public int countItems() throws PDFException
PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public java.lang.String getTagName(int index) throws PDFException
index
- The index of the marked content item. Range: 0 to
(itemCount-1). itemCount
is returned by the
function countItems()
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public boolean hasTag(java.lang.String tagName) throws PDFException
tagName
- Value of the tag name, and it should be valid string.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public java.lang.Object getItemValue(java.lang.String tagName) throws PDFException
tagName
- Value of the tag name, and it should be valid string.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public int getItemType(java.lang.String tagName) throws PDFException
tagName
- Value of the tag name, and it should be valid string.PARAMTYPE_XXX
, and this
should be one of these constants. If not found, -1 will be returned.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void addItem(java.lang.String tagName, int paramType, java.lang.Object item) throws PDFException
tagName
- Value of the tag name, and it should be valid string.paramType
- The type of parameter item. Please refer to constant
definitions PARAMTYPE_XXX
and this should be one of these macros.item
- A parameter item object to be added, and it must match with the parameter type.
Valid item Object and its corresponding parameter type are shown as following: PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void deleteItem(java.lang.String tagName) throws PDFException
tagName
- Value of the tag name, and it should be valid string.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException