WPF DocumentViewer is slower than Microsoft XPS viewer

I have a problem displaying dwfx (auto cad) files in our WPF application. I use XpsDocument

to display such files.

The problem is lack of performance for more complex files. It once contained thousands of forms, even though we advise clients to export them as easily as possible.

Due to the lack of performance, I mean scrolling and zooming compared to the Microsoft XPS viewer, which opens such files by default.

Does anyone have any experience? Can I achieve the same scrolling and zooming effect in WPF Document Viewer as I see in Windows XPS Viewer?

Example file: https://1drv.ms/u/s!AhKm-nEB-Yrths4rY7b0V2rAWE4y1g (444 kB)

And here's how to show it in a wpf application. 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();
    }
}

      

+3


source to share





All Articles