Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How to open a XPS in a specified bookmarks

$
0
0

in a WPF app, im using a manual.xps file that has bookmarks. I can load the file , click on bookmarks and document actually scrolls to the target bookmark, so till there everything works fine.

<Window Class="ClasificadorTablasWPF.HelpDlg"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		Title="Ayuda" Height="571" Width="796"  ><Grid><Frame x:Name="DocFrame" ><Frame.Content><DocumentViewer x:Name="DocView"  /></Frame.Content></Frame></Grid></Window>

ive placed my manual.xps in c:\manual.xps just to avoid any confusion bout path.

XpsDocument manual = new XpsDocument(@"c:\manual.xps", FileAccess.Read);
DocView.Document = manual.GetFixedDocumentSequence();

now i want to be able to navigate to a specific bookmark using code (not clicking a bookmark). i got bookmarks from DocStruct.struct (unziping the xps). but i cant make it work.

ive tried using DocFrame.Navigate(manual.Uri); but says "Failed to convert resource into object" and thats like giving the exact uri as the XpsDocument is using to load the manual, which works correctly.

tried DocFrame.Source = manual.Uri like some posts says but it wont work neither. what im mising ?





Viewing all articles
Browse latest Browse all 18858

Trending Articles