【发布时间】:2013-11-27 15:42:13
【问题描述】:
使用 iTextSharp 将网页保存为 PDF 时,有没有办法打开另存为窗口?现在我只是将它保存到一个集合文件中。
var pdfDoc = new Document();
const string folderPath = "C:\\SG-ListingPDFs\\";
bool isExists = Directory.Exists(folderPath);
if (!isExists)
Directory.CreateDirectory(folderPath);
var writer = PdfWriter.GetInstance(pdfDoc, new FileStream("C:\\SG-ListingPDFs\\" + detailsViewModel.ListingNumber + ".pdf", FileMode.Create));
pdfDoc.Open();
....Code Here
pdfDoc.Add(table);
TempData["SavedPdF"] = true;
pdfDoc.Close();
【问题讨论】:
-
我创建了一个 razor html to pdf 库,它可能对你也有用。见这里:stackoverflow.com/questions/16517171/…
-
我建议您不要多次询问同一个问题,而是对这个主题进行一些研究,然后在遇到特定问题时再回来。 stackoverflow.com/questions/20245553/…
-
它们是两个不同的东西。
标签: c# asp.net asp.net-mvc asp.net-mvc-4 itextsharp