Created
April 2, 2013 19:13
-
-
Save cjlotz/5295274 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void CreateBookmarks() | |
{ | |
PdfContentByte content = _writer.DirectContent; | |
PdfOutline outline = content.RootOutline; | |
foreach (var bookmark in Bookmarks) | |
{ | |
if (bookmark.IsReleaseHeader) | |
outline = CreatePdfOutline(content.RootOutline, bookmark); | |
else | |
CreatePdfOutline(outline, bookmark); | |
} | |
} | |
private PdfOutline CreatePdfOutline(PdfOutline parent, Bookmark bookmark) | |
{ | |
return new PdfOutline(parent, PdfAction.GotoLocalPage(bookmark.PageNumber, new PdfDestination(bookmark.PageNumber), _writer), bookmark.Title); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment