public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Bookmarks(); //open document PdfBookmarkEditor bookmarkEditor = new PdfBookmarkEditor(); bookmarkEditor.BindPdf(dataDir + "DeleteAllBookmarks.pdf"); //delete bookmark bookmarkEditor.DeleteBookmarks(); //save updated PDF file bookmarkEditor.Save(dataDir + "DeleteAllBookmarks_out.pdf"); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Bookmarks(); //open document PdfBookmarkEditor bookmarkEditor = new PdfBookmarkEditor(); bookmarkEditor.BindPdf(dataDir + "CreateBookmarksAll.pdf"); //create bookmark of all pages bookmarkEditor.CreateBookmarks(); //save updated PDF file bookmarkEditor.Save(dataDir + "Output.pdf"); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Bookmarks(); //open document PdfBookmarkEditor bookmarkEditor = new PdfBookmarkEditor(); bookmarkEditor.BindPdf(dataDir + "CreateBookmark-Page.pdf"); //create bookmark of a particular page bookmarkEditor.CreateBookmarkOfPage("Bookmark Name", 2); //save updated PDF file bookmarkEditor.Save(dataDir + "CreateBookmark-Page_out.pdf"); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Bookmarks(); //open document PdfBookmarkEditor bookmarkEditor = new PdfBookmarkEditor(); bookmarkEditor.BindPdf(dataDir + "CreateBookmarks-PagesProperties.pdf"); //create bookmark of all pages bookmarkEditor.CreateBookmarks(System.Drawing.Color.Green, true, true); //save updated PDF file bookmarkEditor.Save(dataDir + "CreateBookmarks-PagesProperties_out.pdf"); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Bookmarks(); //open document PdfBookmarkEditor bookmarkEditor = new PdfBookmarkEditor(); bookmarkEditor.BindPdf(dataDir + "UpdateBookmark.pdf"); //update bookmark bookmarkEditor.ModifyBookmarks("New Bookmark", "New Title"); //save updated PDF file bookmarkEditor.Save(dataDir + "UpdateBookmark_out.pdf"); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Bookmarks(); //Create PdfBookmarkEditor object PdfBookmarkEditor bookmarkEditor = new PdfBookmarkEditor(); //Open PDF file bookmarkEditor.BindPdf(dataDir + "ExportToXML.pdf"); //Export bookmarks bookmarkEditor.ExportBookmarksToXML(dataDir + "bookmarks.xml"); //Save updated PDF bookmarkEditor.Save(dataDir + "ExportToXML_out.pdf"); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Bookmarks(); //create PdfBookmarkEditor class PdfBookmarkEditor bookmarkEditor = new PdfBookmarkEditor(); //open PDF file bookmarkEditor.BindPdf(dataDir + "ImportFromXML.pdf"); //import bookmarks bookmarkEditor.ImportBookmarksWithXML(dataDir + "bookmarks.xml"); //save updated PDF file bookmarkEditor.Save(dataDir + "ImportFromXML_out.pdf"); }
public static void Run() { // ExStart:DeleteABookmark // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Bookmarks(); // Open document PdfBookmarkEditor bookmarkEditor = new PdfBookmarkEditor(); bookmarkEditor.BindPdf(dataDir + "DeleteABookmark.pdf"); // Delete bookmark bookmarkEditor.DeleteBookmarks("Page2"); // Save updated PDF file bookmarkEditor.Save(dataDir + "DeleteABookmark_out_.pdf"); // ExEnd:DeleteABookmark }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Bookmarks(); //create PdfBookmarkEditor PdfBookmarkEditor bookmarkEditor = new PdfBookmarkEditor(); //open PDF file bookmarkEditor.BindPdf(dataDir + "ExtractBookmarks.pdf"); //extract bookmarks Aspose.Pdf.Facades.Bookmarks bookmarks = bookmarkEditor.ExtractBookmarks(); foreach (Bookmark bookmark in bookmarks) { Console.WriteLine("Title: {0}", bookmark.Title); Console.WriteLine("Page Number: {0}", bookmark.PageNumber); } }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Bookmarks(); //create bookmark Bookmark boomark = new Bookmark(); boomark.PageNumber = 1; boomark.Title = "New Bookmark"; //create PdfBookmarkEditor class PdfBookmarkEditor bookmarkEditor = new PdfBookmarkEditor(); //bind PDF document bookmarkEditor.BindPdf(dataDir + "AddBookmark.pdf"); //create bookmarks bookmarkEditor.CreateBookmarks(boomark); //save updated document bookmarkEditor.Save(dataDir + "AddBookmark_out.pdf"); }
public static void Run() { // ExStart:CreateBookmarkPageRange // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Bookmarks(); // Open document PdfBookmarkEditor bookmarkEditor = new PdfBookmarkEditor(); bookmarkEditor.BindPdf(dataDir + "CreateBookmark-Page.pdf"); // Bookmark name list string[] bookmarkList = { "First" }; // Page list int[] pageList = { 1 }; // Create bookmark of a range of pages bookmarkEditor.CreateBookmarkOfPage(bookmarkList, pageList); // Save updated PDF file bookmarkEditor.Save(dataDir + "CreateBookmarkPageRange_out_.pdf"); // ExEnd:CreateBookmarkPageRange }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Bookmarks(); //create PdfBookmarkEditor PdfBookmarkEditor bookmarkEditor = new PdfBookmarkEditor(); //open PDF file bookmarkEditor.BindPdf(dataDir + "input.PDF"); //extract bookmarks Aspose.Pdf.Facades.Bookmarks bookmarks = bookmarkEditor.ExtractBookmarks(); foreach (Aspose.Pdf.Facades.Bookmark bookmark in bookmarks) { // get the title information of bookmark item Console.WriteLine("Title: {0}", bookmark.Title); // get the destination page for bookmark Console.WriteLine("Page Number: {0}", bookmark.PageNumber); // get the information related to associated action with bookmark Console.WriteLine("Bookmark Action: " + bookmark.Action); } }
public static void Run() { // ExStart:AddChildBookmark // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Bookmarks(); // Create bookmarks Aspose.Pdf.Facades.Bookmarks bookmarks = new Aspose.Pdf.Facades.Bookmarks(); Bookmark childBookmark1 = new Bookmark(); childBookmark1.PageNumber = 1; childBookmark1.Title = "First Child"; Bookmark childBookmark2 = new Bookmark(); childBookmark2.PageNumber = 2; childBookmark2.Title = "Second Child"; bookmarks.Add(childBookmark1); bookmarks.Add(childBookmark2); Bookmark bookmark = new Bookmark(); bookmark.Action = "GoTo"; bookmark.PageNumber = 1; bookmark.Title = "Parent"; bookmark.ChildItems = bookmarks; // Create PdfBookmarkEditor class PdfBookmarkEditor bookmarkEditor = new PdfBookmarkEditor(); // Bind PDF document bookmarkEditor.BindPdf(dataDir + "AddChildBookmark.pdf"); // Create bookmarks bookmarkEditor.CreateBookmarks(bookmark); // Save updated document bookmarkEditor.Save(dataDir + "AddChildBookmark_out_.pdf"); // ExEnd:AddChildBookmark }