/// <summary>
        /// Load PDF document bookmark
        /// </summary>
        private void LoadBookmarks()
        {
            if (this.pdfDocumentViewer1.IsDocumentLoaded)
            {
                PdfDocumentBookmarkContainer container = this.pdfDocumentViewer1.GetBookmarkContainer();
                if (container == null)
                {
                    MessageBox.Show("Current PDF document has not bookmarks");
                    return;
                }
                this.treeViewBookmark.Nodes.Clear();
                PdfDocumentBookmark[] bookmarks = container.Childs;
                for (int i = 0; i < bookmarks.Length; i++)
                {
                    PdfDocumentBookmark bookmark = bookmarks[i];

                    TreeNode node  = new TreeNode();
                    string   title = bookmark.Title;
                    node.Text      = title;
                    node.ForeColor = bookmark.Color;
                    FontStyle style = (FontStyle)bookmark.Style;
                    Font      font  = this.treeViewBookmark.Font;
                    node.NodeFont = new Font(font, style);
                    node.Tag      = bookmark;
                    this.treeViewBookmark.Nodes.Add(node);
                    this.LoadChidNode(node);
                }
            }
        }
        /// <summary>
        /// Go to PDF document bookmark
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void treeViewBookmark_AfterSelect(object sender, TreeViewEventArgs e)
        {
            TreeNode            node     = e.Node;
            PdfDocumentBookmark bookmark = (PdfDocumentBookmark)(node.Tag);

            this.pdfDocumentViewer1.GoToBookmark(bookmark);
        }
 private void pdfDocumentViewer1_PdfLoaded(object sender, EventArgs args)
 {
     if (this.pdfDocumentViewer1.IsDocumentLoaded)
     {
         PdfDocumentBookmarkContainer container = this.pdfDocumentViewer1.GetBookmarkContainer();
         if (container == null)
         {
             MessageBox.Show("Current PDF document has not bookmarks");
             return;
         }
         this.treeView1.Items.Clear();
         PdfDocumentBookmark[] bookmarks = container.Childs;
         if (bookmarks.Length > 0)
         {
             for (int i = 0; i < bookmarks.Length; i++)
             {
                 PdfDocumentBookmark bookmark = bookmarks[i];
                 TreeViewItem        node     = new TreeViewItem();
                 node.Header = bookmark.Title;
                 Color fontColor = bookmark.Color;
                 node.Foreground = new SolidColorBrush(fontColor);
                 node.Tag        = bookmark;
                 this.LoadChidNode(node);
                 this.treeView1.Items.Add(node);
             }
         }
     }
 }
        private void TreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            TreeViewItem node = (TreeViewItem)e.NewValue;

            if (node == null)
            {
                return;
            }
            PdfDocumentBookmark bookmark = node.Tag as PdfDocumentBookmark;

            if (this.pdfDocumentViewer1.IsDocumentLoaded)
            {
                this.pdfDocumentViewer1.GoToBookmark(bookmark);
            }
        }
        private void LoadChidNode(TreeViewItem node)
        {
            PdfDocumentBookmark bookmark = node.Tag as PdfDocumentBookmark;
            int childCount = bookmark.Children.Count;

            if (childCount > 0)
            {
                for (int i = 0; i < childCount; i++)
                {
                    PdfDocumentBookmark childBookmark = bookmark.Children[i];
                    TreeViewItem        childNode     = new TreeViewItem();
                    childNode.Header     = childBookmark.Title;
                    childNode.Foreground = new SolidColorBrush(childBookmark.Color);
                    childNode.Tag        = childBookmark;
                    node.Items.Add(childNode);
                    this.LoadChidNode(childNode);
                }
            }
        }
        /// <summary>
        /// Load specified bookmark children bookmark
        /// </summary>
        /// <param name="node"></param>
        private void LoadChidNode(TreeNode node)
        {
            PdfDocumentBookmark bookmark = node.Tag as PdfDocumentBookmark;
            int childCount = bookmark.Children.Count;

            if (childCount > 0)
            {
                for (int i = 0; i < childCount; i++)
                {
                    PdfDocumentBookmark childBookmark = bookmark.Children[i];
                    TreeNode            childNode     = new TreeNode();
                    childNode.Text      = childBookmark.Title;
                    childNode.ForeColor = childBookmark.Color;
                    FontStyle style = (FontStyle)bookmark.Style;
                    Font      font  = this.treeViewBookmark.Font;
                    childNode.NodeFont = new Font(font, style);
                    childNode.Tag      = childBookmark;
                    node.Nodes.Add(childNode);
                    LoadChidNode(childNode);
                }
            }
        }