在我的应用程序中,我需要能够创建带有页眉/页脚、图片、文本等的 PDF 报告。现在我找到了一个图书馆 migradoc,但我无法弄清楚 atm。当用户按下“创建”按钮时,如何打印/显示正在创建的文件?
在 PdfSharp 中我只能说document.Save(Url)
and Process.Start(url)
,但我不能对 Migradoc 做同样的事情。
在我的应用程序中,我需要能够创建带有页眉/页脚、图片、文本等的 PDF 报告。现在我找到了一个图书馆 migradoc,但我无法弄清楚 atm。当用户按下“创建”按钮时,如何打印/显示正在创建的文件?
在 PdfSharp 中我只能说document.Save(Url)
and Process.Start(url)
,但我不能对 Migradoc 做同样的事情。
MigraDoc 使用 PDFsharp。您只需调用保存并开始,就像使用 PDFsharp 一样:
// Save the document...
const string filename = "HelloWorld.pdf";
pdfRenderer.PdfDocument.Save(filename);
// ...and start a viewer.
Process.Start(filename);
来自 MigraDoc 附带的 HelloWorld 示例的代码片段。另见:
http ://www.pdfsharp.net/wiki/MigraDocHelloWorld-sample.ashx