PdfBookmarkEditor.CreateBookmarks

CreateBookmarks()

Creates bookmarks for all pages.

public void CreateBookmarks()

Examples

PdfBookmarkEditor editor = new PdfBookmarkEditor();
editor.BindPdf("example.pdf");
editor.CreateBookmarks();
editor.Save("example_out.pdf");

See Also


CreateBookmarks(Bookmark)

Creates the specified bookmark in the document. The method can be used for forming nested bookmarks hierarchy.

public void CreateBookmarks(Bookmark bookmark)
ParameterTypeDescription
bookmarkBookmarkThe bookmark will be added to the document.

Examples

PdfBookmarkEditor editor = new PdfBookmarkEditor();
editor.BindPdf("example.pdf");
Bookmark bm1=new Bookmark();
bm1.PageNumber=1;
bm1.Title="First child";
Bookmark bm2=new Bookmark();
bm2.PageNumber=2;
bm2.Title="Second child";
Bookmark bm=new Bookmark();
bm.Action="GoTo";
bm.PageNumber=1;
bm.Title="Parent";
Bookmarks bms=new Bookmarks();
bms.Add(bm1);
bms.Add(bm2);
bm.ChildItem=bms;
editor.CreateBookmarks(bm);
editor.Save("example_out.pdf");

See Also


CreateBookmarks(Color, bool, bool)

Create bookmarks for all pages with specified color and style (bold, italic).

public void CreateBookmarks(Color color, bool boldFlag, bool italicFlag)
ParameterTypeDescription
colorColorThe color of title.
boldFlagBooleanThe flag of bold attribution.
italicFlagBooleanThe flag of italic attribution.

Examples

PdfBookmarkEditor editor = new PdfBookmarkEditor();
editor.BindPdf("example.pdf");
editor.CreateBookmarks(System.Drawing.Color.Red, true, true);
editor.Save("example_out.pdf");

See Also