[英]how to load one specific xps document into DocumentViewer for reading without loading it when application start
我只做了一個按鈕來添加一個文檔。 是否可以以某種方式從具有 Visual Studio 項目或其他內容的文件夾中加載文檔?
private void Load_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "XPS file (*.xps)|*.xps";
if (ofd.ShowDialog() == true)
{
XpsDocument doc = new XpsDocument(ofd.FileName, FileAccess.Read);
documentViewer.Document = doc.GetFixedDocumentSequence();
}
}
private void Book1_Click(object sender, RoutedEventArgs e)
{
var xpsDocument = new XpsDocument(@"C:documentPath", FileAccess.Read);
documentViewer.Document = xpsDocument.GetFixedDocumentSequence();
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.