Exemple #1
0
        private void LoadBookmarks(PdfBookmarkCollection bookmarks, IntPtr bookmark)
        {
            if (bookmark == IntPtr.Zero)
            {
                return;
            }

            bookmarks.Add(LoadBookmark(bookmark));
            while ((bookmark = NativePdfiumMethods.FPDF_BookmarkGetNextSibling(_document, bookmark)) != IntPtr.Zero)
            {
                bookmarks.Add(LoadBookmark(bookmark));
            }
        }
Exemple #2
0
        private void LoadBookmarks(PdfBookmarkCollection bookmarks, IntPtr bookmark)
        {
            if (bookmark == IntPtr.Zero)
            {
                return;
            }

            bookmarks.Add(LoadBookmark(bookmark));
            while ((bookmark = PdfiumLibrary.FPDFBookmark_GetNextSibling(_document, bookmark)) != IntPtr.Zero)
            {
                bookmarks.Add(LoadBookmark(bookmark));
            }
        }
Exemple #3
0
        private PdfBookmarkCollection LoadBookmarks(IntPtr bookmark)
        {
            var result = new PdfBookmarkCollection();

            if (bookmark == IntPtr.Zero)
            {
                return(result);
            }

            result.Add(LoadBookmark(bookmark));

            while ((bookmark = NativeMethods.FPDF_BookmarkGetNextSibling(_document, bookmark)) != IntPtr.Zero)
            {
                result.Add(LoadBookmark(bookmark));
            }

            return(result);
        }
        private void TranslateBookmarks(PdfBookmarkCollection result, PdfBookmarkCollection bookmarks)
        {
            foreach (var bookmark in bookmarks)
            {
                if (bookmark.PageIndex >= _startPage && bookmark.PageIndex <= _endPage)
                {
                    var resultBookmark = new PdfBookmark
                    {
                        PageIndex = bookmark.PageIndex - _startPage,
                        Title     = bookmark.Title
                    };

                    TranslateBookmarks(resultBookmark.Children, bookmark.Children);

                    result.Add(resultBookmark);
                }
            }
        }
Exemple #5
0
        private void LoadBookmarks(PdfBookmarkCollection bookmarks, IntPtr bookmark)
        {
            if (bookmark == IntPtr.Zero)
                return;

            bookmarks.Add(LoadBookmark(bookmark));
            while ((bookmark = NativeMethods.FPDF_BookmarkGetNextSibling(_document, bookmark)) != IntPtr.Zero)
                bookmarks.Add(LoadBookmark(bookmark));
        }