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? –