pvginkel / PdfiumViewer

PDF viewer based on Google's PDFium.
Apache License 2.0
967 stars 418 forks source link

Bookmark PageIndex Always 0 with the Provided Sample.pdf #123

Closed datauduong closed 7 years ago

datauduong commented 7 years ago

I am trying the PdfiumViewer.Demo project, which can show bookmark.

But the Sample.pdf that I have does not respond to the bookmark select

After Investigation futher, it is because the PageIndex = 0 for all bookmarks Thanks.

datauduong commented 7 years ago

Sample.PDF

I have re-test the demo, it is working with the provided Example 1 and Example 2, _bookmarks_AfterSelect it does triggered the Sample.PDF

But PageIndex is Always 0

private void UpdateBookmarks() { bool visible = _showBookmarks && _document != null && _document.Bookmarks.Count > 0;

        _container.Panel1Collapsed = !visible;

        if (visible)
        {
            _container.Panel1Collapsed = false;

            _bookmarks.Nodes.Clear();
            foreach (var bookmark in _document.Bookmarks)

// bookmark.PageIndex is Always 0 with the provided Sample.pdf _bookmarks.Nodes.Add(GetBookmarkNode(bookmark)); } }

pvginkel commented 7 years ago

I think this is a problem in PDFium. The bookmarks also don't work in Google Chrome. Funny thing though is that they do work in Foxit (from where the PDFium library comes). I've tried a few things in code like getting the action type of the bookmark, which returns unsupported.

I don't think there is anything I can do about this. Sorry.