public class Bookmark extends Object
Represents a bookmark item in the PDF.
[C#] Pdf pdf1 = new Pdf(); pdf1.IsBookmarked = true; pdf1.BookMarkLevel = 1;? Section sec1 = pdf1.Sections.Add(); Heading heading1 = new Heading(pdf1,sec1,1); Segment segment1 = new Segment(heading1); heading1.Segments.Add(segment1); heading1.IsAutoSequence = true; segment1.Content = "this is heading of level 1"; sec1.Paragraphs.Add(heading1); Heading heading2 = new Heading(pdf1,sec1,2); Segment segment2 = new Segment(heading2); heading2.Segments.Add(segment2); heading2.IsAutoSequence = true; segment2.Content = "this is heading of level 2"; sec1.Paragraphs.Add(heading2); Heading heading3 = new Heading(pdf1,sec1,1); Segment segment3 = new Segment(heading3); heading3.Segments.Add(segment3); heading3.IsAutoSequence = false; heading3.LabelWidth = 60; heading3.UserLabel = "bullet1"; segment3.Content = "this is bullet style 1"; sec1.Paragraphs.Add(heading3); pdf1.Save("testHeading.pdf"); [Visual Basic] Dim pdf1 As Pdf = New Pdf() pdf1.IsBookmarked = True pdf1.BookMarkLevel = 1 Dim sec1 As Section = pdf1.Sections.Add() Dim heading1 As Heading = New Heading(pdf1, sec1, 1) Dim segment1 As Segment = New Segment(heading1) heading1.Segments.Add(segment1) heading1.IsAutoSequence = True segment1.Content = "this is heading of level 1" sec1.Paragraphs.Add(heading1) Dim heading2 As Heading = New Heading(pdf1, sec1, 2) Dim segment2 As Segment = New Segment(heading2) heading2.Segments.Add(segment2) heading2.IsAutoSequence = True segment2.Content = "this is heading of level 2" sec1.Paragraphs.Add(heading2) Dim heading3 As Heading = New Heading(pdf1, sec1, 1) Dim segment3 As Segment = New Segment(heading3) heading3.Segments.Add(segment3) heading3.IsAutoSequence = False heading3.LabelWidth = 60 heading3.UserLabel = "bullet1" segment3.Content = "this is bullet style 1" sec1.Paragraphs.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 |
---|---|
com.aspose.ms.System.Collections.ArrayList |
LinkActions |
Constructor and Description |
---|
Bookmark() |
Modifier and Type | Method and Description |
---|---|
void |
addLinkAction(LinkAction action) |
Bookmarks |
getChildBookmarks()
Gets or sets a
ChildBookmarks object that indicates the child bookmarks. |
String |
getLinkParagraphID()
Gets or sets a string that indicates the ID of the paragraph that the bookmark item links to.
|
int |
getPageNumber()
Gets or sets a int number that indicates the page number of the bookmark link.
|
String |
getTitle()
Gets or sets a string that indicates the title of the bookmark.
|
float |
getYPosition()
Gets or sets a float number that indicates the Y coordination of the bookmark link.
|
boolean |
isExpanded()
Gets or sets a bool value that indicates whether the bookmark item is expanded if it has child bookmarks.
|
void |
isExpanded(boolean value) |
void |
setChildBookmarks(Bookmarks value) |
void |
setLinkParagraphID(String value) |
void |
setPageNumber(int value) |
void |
setTitle(String value) |
void |
setYPosition(float value) |
public String getLinkParagraphID()
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 void setLinkParagraphID(String value)
public Bookmarks getChildBookmarks()
Gets or sets a ChildBookmarks
object that indicates the child bookmarks.
public void setChildBookmarks(Bookmarks value)
public String getTitle()
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 void setTitle(String value)
public int getPageNumber()
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 void setPageNumber(int value)
public float getYPosition()
Gets or sets a float number that indicates the Y coordination of the bookmark link. The origin of
the coordination is the lower-left corner of the page. If the LinkParagraphID
is set,
this property is not needed.
public void setYPosition(float value)
public boolean isExpanded()
Gets or sets a bool value that indicates whether the bookmark item is expanded if it has child bookmarks.
public void isExpanded(boolean value)
public void addLinkAction(LinkAction action)
Copyright © 2016 Aspose. All Rights Reserved.