Class OutlineItem
- java.lang.Object
-
- com.pdftools.toolbox.internal.NativeBase
-
- com.pdftools.toolbox.internal.NativeObject
-
- com.pdftools.toolbox.pdf.navigation.OutlineItem
-
public class OutlineItem extends NativeObject
An outline item represents an entry in the outline tree of the document. It is also known as "Bookmark".
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OutlineItem
copy(Document targetDocument, OutlineItem outlineItem, OutlineCopyOptions options)
Copy an outline itemstatic OutlineItem
create(Document targetDocument, java.lang.String title, Destination destination)
Create a new outline item (bookmark).boolean
getBold()
Iftrue
, the outline item is displayed in bold font.OutlineItemList
getChildren()
The child items of this outline item.Destination
getDestination()
The destination of the outline item.boolean
getIsOpen()
Iftrue
, the item is expanded.boolean
getItalic()
Iftrue
, the outline item is displayed in italic font.java.lang.String
getTitle()
The title of the outline item.void
setBold(boolean value)
Iftrue
, the outline item is displayed in bold font.void
setDestination(Destination value)
The destination of the outline item.void
setIsOpen(boolean value)
Iftrue
, the item is expanded.void
setItalic(boolean value)
Iftrue
, the outline item is displayed in italic font.void
setTitle(java.lang.String value)
The title of the outline item.-
Methods inherited from class com.pdftools.toolbox.internal.NativeObject
equals, hashCode
-
-
-
-
Method Detail
-
create
public static OutlineItem create(Document targetDocument, java.lang.String title, Destination destination)
Create a new outline item (bookmark).
The returned outline item is not yet part of the outline item tree, but it is associated with the given target document. It can be inserted at any position in the tree.- Parameters:
targetDocument
- The output document with which the returned object is associatedtitle
- The title of the newly created outline item.destination
- The destination that this outline item refers to ornull
if the item has no destination.- Returns:
- The newly created outline item.
- Throws:
java.lang.IllegalArgumentException
- if thetargetDocument
argument has already been closedjava.lang.IllegalArgumentException
- if thetargetDocument
argument is read-onlyjava.lang.IllegalArgumentException
- if the document associated with thedestination
argument has already been closedjava.lang.IllegalArgumentException
- if thedestination
argument belongs to a different documentjava.lang.IllegalArgumentException
- iftargetDocument
isnull
java.lang.IllegalArgumentException
- iftitle
isnull
-
copy
public static OutlineItem copy(Document targetDocument, OutlineItem outlineItem, OutlineCopyOptions options) throws java.io.IOException, ConformanceException
Copy an outline item
Copy an outline item object including all descendants from an input document to the giventargetDocument
. The returned object is associated with the given target document but not yet part of it.- Parameters:
targetDocument
- the output document with which the returned object is associatedoutlineItem
- An outline item of a different documentoptions
- The options used to copy the item- Returns:
- The copied outline item, associated with the current document.
- Throws:
ConformanceException
- The conformance level of the source document is not compatible with the conformance level of the target document.java.lang.IllegalArgumentException
- if thetargetDocument
argument isnull
java.lang.IllegalArgumentException
- if thetargetDocument
argument has already been closedjava.lang.IllegalArgumentException
- if thetargetDocument
argument is read-onlyjava.lang.IllegalArgumentException
- if theoutlineItem
argument is not associated with an input documentjava.lang.IllegalArgumentException
- the target document contains implicitly copied outline itemsjava.lang.IllegalArgumentException
- theoutlineItem
argument isnull
java.lang.IllegalArgumentException
- theoutlineItem
argument is not associated with an input documentjava.io.IOException
- Error reading from the source document or writing to the target documentjava.lang.IllegalArgumentException
- iftargetDocument
isnull
java.lang.IllegalArgumentException
- ifoutlineItem
isnull
-
getTitle
public java.lang.String getTitle()
The title of the outline item.- Throws:
java.lang.IllegalStateException
- the object has already been closed.java.lang.IllegalStateException
- the associated document has already been closed.
-
setTitle
public void setTitle(java.lang.String value)
The title of the outline item.- Throws:
java.lang.IllegalStateException
- the object has already been closed.java.lang.IllegalStateException
- the associated document has already been closed.java.lang.UnsupportedOperationException
- the object is not associated to an output document.java.lang.IllegalArgumentException
- ifvalue
isnull
-
getBold
public boolean getBold()
Iftrue
, the outline item is displayed in bold font.- Throws:
java.lang.IllegalStateException
- the object has already been closed.java.lang.IllegalStateException
- the associated document has already been closed.
-
setBold
public void setBold(boolean value)
Iftrue
, the outline item is displayed in bold font.- Throws:
java.lang.IllegalStateException
- the object has already been closed.java.lang.IllegalStateException
- the associated document has already been closed.java.lang.UnsupportedOperationException
- the object is not associated to an output document.
-
getItalic
public boolean getItalic()
Iftrue
, the outline item is displayed in italic font.- Throws:
java.lang.IllegalStateException
- the object has already been closed.java.lang.IllegalStateException
- the associated document has already been closed.
-
setItalic
public void setItalic(boolean value)
Iftrue
, the outline item is displayed in italic font.- Throws:
java.lang.IllegalStateException
- the object has already been closed.java.lang.IllegalStateException
- the associated document has already been closed.java.lang.UnsupportedOperationException
- the object is not associated to an output document.
-
getDestination
public Destination getDestination()
The destination of the outline item.- Throws:
java.lang.IllegalStateException
- the object has already been closed.java.lang.IllegalStateException
- the associated document has already been closed.java.lang.UnsupportedOperationException
- the object is not associated to an input document.
-
setDestination
public void setDestination(Destination value)
The destination of the outline item.- Throws:
java.lang.IllegalStateException
- the object has already been closed.java.lang.IllegalStateException
- the associated document has already been closed.java.lang.UnsupportedOperationException
- the object is not associated to an output document.
-
getIsOpen
public boolean getIsOpen()
-
If
true
, the item is expanded. -
If
false
, the item is collapsed.
- Throws:
java.lang.IllegalStateException
- the object has already been closed.java.lang.IllegalStateException
- the associated document has already been closed.
-
If
-
setIsOpen
public void setIsOpen(boolean value)
-
If
true
, the item is expanded. -
If
false
, the item is collapsed.
- Throws:
java.lang.IllegalStateException
- the object has already been closed.java.lang.IllegalStateException
- the associated document has already been closed.java.lang.UnsupportedOperationException
- the object is not associated to an output document.
-
If
-
getChildren
public OutlineItemList getChildren()
The child items of this outline item.- Throws:
java.lang.IllegalStateException
- the object has already been closed.java.lang.IllegalStateException
- the associated document has already been closed.
-
-