當前位置: 首頁>>代碼示例>>Java>>正文


Java Bookmark類代碼示例

本文整理匯總了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.");
}
 
開發者ID:asposemarketplace,項目名稱:Aspose_Java_for_Docx4j,代碼行數:21,代碼來源:AsposeBookmarks.java

示例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.");
}
 
開發者ID:asposemarketplace,項目名稱:Aspose_Words_for_Apache_POI,代碼行數:22,代碼來源:AsposeBookmarks.java

示例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.");
}
 
開發者ID:asposemarketplace,項目名稱:Aspose_Java_for_Docx4j,代碼行數:14,代碼來源:AsposeBookmarksDelete.java


注:本文中的com.aspose.words.Bookmark類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。