0
嗨我正在使用WPF文檔查看器查看文檔 有什麼方法可以將文檔另存爲PDF?WPF文檔查看器導出爲PDF
<DocumentViewer Name="documentViewer" />
我正在使用WPFReports來生成報告。
嗨我正在使用WPF文檔查看器查看文檔 有什麼方法可以將文檔另存爲PDF?WPF文檔查看器導出爲PDF
<DocumentViewer Name="documentViewer" />
我正在使用WPFReports來生成報告。
據我所知,不,你不能。但是,您可以將DocumentViewer呈現到XPS,然後將那個呈現給PDF。
<Label>
<Hyperlink Click="lnkSelectDocument_Click">
<Label Content="{Binding ShortFielName}">
</Label>
</Hyperlink>
</Label>
private void lnkSelectDocument_Click(object sender, RoutedEventArgs e) {
try {
System.Diagnostics.Process process = new System.Diagnostics.Process();
string path = "d:\\test.doc";
Uri pdf = new Uri(path, UriKind.RelativeOrAbsolute);
process.StartInfo.FileName = pdf.LocalPath;
process.Start();
process.WaitForExit();
} catch (Exception error) {
MessageBox.Show("Could not open the file.", "Error", MessageBoxButton.OK,
MessageBoxImage.Warning);
}
}
您是否有任何示例代碼將XPS轉換爲PDF? –