本文整理匯總了Java中com.aspose.words.Bookmark類的典型用法代碼示例。如果您正苦於以下問題:Java Bookmark類的具體用法?Java Bookmark怎麽用?Java Bookmark使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Bookmark類屬於com.aspose.words包,在下文中一共展示了Bookmark類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: main
import com.aspose.words.Bookmark; //導入依賴的package包/類
public static void main(String[] args) throws Exception
{
String dataPath = "src/featurescomparison/workingwithbookmarks/addbookmark/data/";
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.startBookmark("AsposeBookmark");
builder.writeln("Text inside a bookmark.");
builder.endBookmark("AsposeBookmark");
// By index.
Bookmark bookmark1 = doc.getRange().getBookmarks().get(0);
// By name.
Bookmark bookmark2 = doc.getRange().getBookmarks().get("AsposeBookmark");
doc.save(dataPath + "Aspose_Bookmark.doc", SaveFormat.DOC);
System.out.println("Done.");
}
示例2: main
import com.aspose.words.Bookmark; //導入依賴的package包/類
public static void main(String[] args) throws Exception
{
String dataPath = "src/asposefeatures/workingwithdocument/workingwithbookmarks/data/";
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.startBookmark("AsposeBookmark");
builder.writeln("Text inside a bookmark.");
builder.endBookmark("AsposeBookmark");
// By index.
Bookmark bookmark1 = doc.getRange().getBookmarks().get(0);
// By name.
Bookmark bookmark2 = doc.getRange().getBookmarks().get("AsposeBookmark");
doc.save(dataPath + "AsposeBookmark.doc", SaveFormat.DOC);
System.out.println("Done.");
}
示例3: main
import com.aspose.words.Bookmark; //導入依賴的package包/類
public static void main(String[] args) throws Exception
{
String dataPath = "src/featurescomparison/workingwithbookmarks/deletebookmark/data/";
Document doc = new Document(dataPath + "Aspose_Bookmark.doc");
// By name.
Bookmark bookmark = doc.getRange().getBookmarks().get("AsposeBookmark");
bookmark.remove();
doc.save(dataPath + "Aspose_BookmarkDeleted.doc", SaveFormat.DOC);
System.out.println("Done.");
}