public class Bookmark extends XmlEntityWithInternals implements ILinkActionsCarrier
Represents a bookmark item in the PDF.
[Java] Pdf pdf1 = new Pdf(); pdf1.setIsBookmarked ( true); pdf1.setBookMarkLevel ( 1;) Section sec1 = pdf1.getSections().add(); Heading heading1 = new Heading(pdf1,sec1,1); Segment segment1 = new Segment(heading1); heading1.getSegments().add(segment1); heading1.setIsAutoSequence ( true); segment1.setContent ( "this is heading of level 1"); sec1.getParagraphs().add(heading1); Heading heading2 = new Heading(pdf1,sec1,2); Segment segment2 = new Segment(heading2); heading2.getSegments().add(segment2); heading2.setIsAutoSequence ( true); segment2.setContent ( "this is heading of level 2"); sec1.getParagraphs().add(heading2); Heading heading3 = new Heading(pdf1,sec1,1); Segment segment3 = new Segment(heading3); heading3.getSegments().add(segment3); heading3.setIsAutoSequence ( false); heading3.setLabelWidth ( 60); heading3.setUserLabel ( "bullet1"); segment3.setContent ( "this is bullet style 1"); sec1.getParagraphs().add(heading3); pdf1.save("testHeading.pdf"); [XML] <?xml version="1.0" encoding="utf-8" ?> <Pdf xmlns="Aspose.Pdf" IsBookmarked="true" BookMarkLevel="1"> <Section> <Heading Level="1" IsAutoSequence="true"> <Segment>this is heading of level 1</Segment> </Heading> <Heading Level="2" IsAutoSequence="true"> <Segment>this is heading of level 2</Segment> </Heading> <Heading Level="1" IsAutoSequence="false" LabelWidth="60" UserLabel="bullet1"> <Segment>this is bullet style 1</Segment> </Heading> </Section> </Pdf>
Modifier and Type | Field and Description |
---|---|
Bookmarks |
ChildBookmarks
Gets or sets a
ChildBookmarks object that indicates the child bookmarks. |
boolean |
IsExpanded
Gets or sets a bool value that indicates whether the bookmark item is expanded if it has child bookmarks.
|
String |
LinkParagraphID
Gets or sets a string that indicates the ID of the paragraph that the bookmark item links to.
|
int |
PageNumber
Gets or sets a int number that indicates the page number of the bookmark link.
|
String |
Title
Gets or sets a string that indicates the title of the bookmark.
|
float |
YPosition
Gets or sets a float number that indicates the Y coordination of the bookmark link.
|
Constructor and Description |
---|
Bookmark() |
Modifier and Type | Method and Description |
---|---|
void |
addLinkAction(LinkAction addedAction) |
int |
getCountOfLinkActions() |
LinkAction |
getLinkAction(int index) |
load
public String LinkParagraphID
Gets or sets a string that indicates the ID of the paragraph that the bookmark item links to.
If this property is set, the PageNumber
and YPosition
properties
are not needed. If the link paragraph is Text
or Heading
and the
Title
is not set, the content of the Text
or Heading
will be used as the title of the bookmark item.
public Bookmarks ChildBookmarks
Gets or sets a ChildBookmarks
object that indicates the child bookmarks.
public String Title
Gets or sets a string that indicates the title of the bookmark. If the
LinkParagraphID
is set and the linked paragraph is Text
or
Heading
and this property is not set, the content of the Text
or
Heading
will be used as the title of the bookmark item.
public int PageNumber
Gets or sets a int number that indicates the page number of the bookmark link. If the LinkParagraphID
is set,
this property is not needed.
public float YPosition
Gets or sets a float number that indicates the Y coordination of the bookmark link. The origin of
is in the lower-left corner of the page. If the LinkParagraphID
is set,
this property is not needed.
public boolean IsExpanded
Gets or sets a bool value that indicates whether the bookmark item is expanded if it has child bookmarks.
public void addLinkAction(LinkAction addedAction)
addLinkAction
in interface ILinkActionsCarrier
public int getCountOfLinkActions()
getCountOfLinkActions
in interface ILinkActionsCarrier
public LinkAction getLinkAction(int index)
getLinkAction
in interface ILinkActionsCarrier
Copyright © 2014 Aspose. All Rights Reserved.