I'm dealing with problem to show dwfx (auto cad) files in our WPF application. I'm using XpsDocument
to show such a files.
Problem is lack of performance in case of more complex files. Sometime containing thousands of shapes, despite the fact we advise customers to export it as simple as they can.
By lack of performance I mean scroll and zoom when compared to Microsoft XPS viewer which opens this kind of files by default.
Have anybody experience with this? Can I achieve same scroll and zoom experience in WPF document viewer as I can see in Windows XPS viewer?
Sample file: https://1drv.ms/u/s!AhKm-nEB-Yrths4rY7b0V2rAWE4y1g (444 kB)
And this is how to show it in wpf app. xaml:
<Window x:Class="WpfApplication10.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow"
Width="525"
Height="350">
<Grid>
<DocumentViewer x:Name="dv" />
</Grid>
</Window>
Code behind:
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
var file = @".\Plan-04.dwfx";
using (XpsDocument xpsDocument = new XpsDocument(file, FileAccess.Read))
dv.Document = xpsDocument.GetFixedDocumentSequence();
}
}