【发布时间】:2021-02-26 09:44:10
【问题描述】:
我在以 PDF 格式打印数据和图像时遇到问题。我使用下面的代码,它分别打印图像和数据。但我希望它们在一个 PDF 中,我该怎么做?
PrintDialog export = new PrintDialog();
string data = "data";
System.Windows.Documents.FlowDocument flowDoc = new System.Windows.Documents.FlowDocument(new System.Windows.Documents.Paragraph(new System.Windows.Documents.Run(data)));
System.Windows.Documents.IDocumentPaginatorSource source = flowDoc;
var result = export.ShowDialog();
if(result == true)
{
export.PrintVisual(souradnySystem, "Visual");
export.PrintDocument(source.DocumentPaginator, "Text");
}
【问题讨论】: