【发布时间】:2011-07-30 03:25:05
【问题描述】:
我正在使用 iTextSharp 生成 pdf。我想在网页上显示它并让用户从在线 pdf 查看器中保存它。 dynamicpdf 有一个 drawtoweb() 方法,但它不是免费使用的,我无法使用 iTextSharp 找到相同的功能。如何显示pdf?
string newFile = "Pdf Document.pdf";
Document doc = new Document();
PdfWriter writer = PdfWriter.GetInstance(doc, new FileStream(newFile, FileMode.Create));
doc.AddCreator("Myself");
doc.AddTitle("Sample PDF Document");
doc.Open();
doc.Add(new Paragraph("Hello, World!"));
doc.Close();
【问题讨论】:
标签: c# asp.net pdf pdf-generation itextsharp