Class PDMarkedContent
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.documentinterchange.markedcontent.PDMarkedContent
-
- Direct Known Subclasses:
PDArtifactMarkedContent
public class PDMarkedContent extends java.lang.Object
A marked content.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.Object>
contents
private COSDictionary
properties
private java.lang.String
tag
-
Constructor Summary
Constructors Constructor Description PDMarkedContent(COSName tag, COSDictionary properties)
Creates a new marked content object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMarkedContent(PDMarkedContent markedContent)
Adds a marked content to the contents.void
addText(TextPosition text)
Adds a text position to the contents.void
addXObject(PDXObject xobject)
Adds an XObject to the contents.static PDMarkedContent
create(COSName tag, COSDictionary properties)
Creates a marked-content sequence.java.lang.String
getActualText()
Gets the actual text (ActualText).java.lang.String
getAlternateDescription()
Gets the alternate description (Alt).java.util.List<java.lang.Object>
getContents()
Gets the contents of the marked content sequence.java.lang.String
getExpandedForm()
Gets the expanded form (E).java.lang.String
getLanguage()
Gets the language (Lang).int
getMCID()
Gets the marked-content identifier.COSDictionary
getProperties()
Gets the properties.java.lang.String
getTag()
Gets the tag.java.lang.String
toString()
-
-
-
Field Detail
-
tag
private final java.lang.String tag
-
properties
private final COSDictionary properties
-
contents
private final java.util.List<java.lang.Object> contents
-
-
Constructor Detail
-
PDMarkedContent
public PDMarkedContent(COSName tag, COSDictionary properties)
Creates a new marked content object.- Parameters:
tag
- the tagproperties
- the properties
-
-
Method Detail
-
create
public static PDMarkedContent create(COSName tag, COSDictionary properties)
Creates a marked-content sequence.- Parameters:
tag
- the tagproperties
- the properties- Returns:
- the marked-content sequence
-
getTag
public java.lang.String getTag()
Gets the tag.- Returns:
- the tag
-
getProperties
public COSDictionary getProperties()
Gets the properties.- Returns:
- the properties
-
getMCID
public int getMCID()
Gets the marked-content identifier.- Returns:
- the marked-content identifier, or -1 if it doesn't exist.
-
getLanguage
public java.lang.String getLanguage()
Gets the language (Lang).- Returns:
- the language
-
getActualText
public java.lang.String getActualText()
Gets the actual text (ActualText).- Returns:
- the actual text
-
getAlternateDescription
public java.lang.String getAlternateDescription()
Gets the alternate description (Alt).- Returns:
- the alternate description
-
getExpandedForm
public java.lang.String getExpandedForm()
Gets the expanded form (E).- Returns:
- the expanded form
-
getContents
public java.util.List<java.lang.Object> getContents()
Gets the contents of the marked content sequence. Can be- Returns:
- the contents of the marked content sequence
-
addText
public void addText(TextPosition text)
Adds a text position to the contents.- Parameters:
text
- the text position
-
addMarkedContent
public void addMarkedContent(PDMarkedContent markedContent)
Adds a marked content to the contents.- Parameters:
markedContent
- the marked content
-
addXObject
public void addXObject(PDXObject xobject)
Adds an XObject to the contents.- Parameters:
xobject
- the XObject
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-