|
|
BookmarksViewer code on WinForms is very simple. There are literally a few lines of code. Therefore, you can easily implement it in the WPF yourself, using any standard control suitable for your application. Source code can be found here: https://github.com/Patag...aster/BookmarksViewer.cs
|
|
|
Hi there,
could you point me to an example on how to implement a bookmark viewer in WPF.
Cheers!
|
|
|
there is a way to do the same thing with wpf pdfviewer?
|
|
|
OMG it works :D? THANKS
|
|
|
if you are using bookmark viewer provided by sdk then you need the following only Code:
pdfViewer1.BookmarksViewer = bookmarksViewer1
PdfViewer implements the scroll to page on click on a bookmark functionality by default.
|
|
|
var node = e.Node as BookmarksViewerNode;
it seems to be not possible, visual studio says it's not possible because its level protection "bookmarksviewermode"
|
|
|
Code:
_bookmarksViewer.AfterSelect += _bookmarksViewer_AfterSelect;
Code:
private void _bookmarksViewer_AfterSelect(object sender, TreeViewEventArgs e)
{
var node = e.Node as BookmarksViewerNode;
if (node == null || node.Bookmark == null)
return;
if (node.Bookmark.Action != null)
ProcessAction(node.Bookmark.Action);
else if (node.Bookmark.Destination != null)
ProcessDestination(node.Bookmark.Destination);
}
BTW, you can do the following: Code:
pdfViewer1.BookmarksViewer = bookmarksViewer1
that's all
|
|
|
thanks and how can i get the action from the bookmarkviewer (node clicked on the treeview) ?
|
|
|
Please look at bookmark's Action and Destination properties here: https://pdfium.patagames.com/help/html/39813c60-72f9-1565-4e1f-0de959822d66.htmThe destination contain the PageIndex property, so you may call PdfViewer.ScrollToPage(destination.PageIndex). Code:
if (Bookmark.Action != null)
ProcessAction(Bookmark.Action);
else if (Bookmark.Destination != null)
ProcessDestination(Bookmark.Destination);
Code:
private void ProcessAction(PdfAction pdfAction)
{
if (pdfAction.ActionType == ActionTypes.Uri)
Process.Start(pdfAction.ActionUrl);
else if (pdfAction.Destination != null)
ProcessDestination(pdfAction.Destination);
}
Code:
private void ProcessDestination(PdfDestination pdfDestination)
{
ScrollToPage(pdfDestination.PageIndex);
Invalidate();
}
|
|
|
hi,
Is there a way when i click on a bookmark in my list of bookmarks to display the page who correspond (in a pdf who contains multiple pages) ?
thank you
|
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close