我正在创建一个在线电影票预订项目。现在我想创建一个票证的pdf文件。如何创建或生成pdf文件。
发布于 2014-04-24 21:05:48
要生成pdf,请使用以下代码
Document document = new Document(iTextSharp.text.PageSize.LETTER, 10, 10, 42, 35);
PdfWriter writer = PdfWriter.GetInstance(document , new FileStream(@"C:\YourPdf.pdf", FileMode.Create));
document .Open();
Paragraph paragraph = new Paragraph("Hi, \n This is my pdf file");
document .Add(paragraph);
document .Close();欲了解更多信息:-
http://www.codeproject.com/Articles/686994/Create-Read-Advance-PDF-Report-using-iTextSharp-in
http://www.dotnetfox.com/articles/how-to-create-pdf-document-in-Asp-Net-with-C-Sharp-using-itextsharp-1023.aspx
发布于 2014-04-24 21:05:01
我以前用过PDF4Net,它非常容易使用。
发布于 2014-04-24 21:07:43
此外,我还使用了PDFSharp,它非常简单直观!干杯
https://stackoverflow.com/questions/23269753
复制相似问题