【发布时间】:2015-05-06 17:44:50
【问题描述】:
我在我的 MVC 应用程序中使用 iTextSharp 创建一个 .pdf 文件,但有没有办法将它转换为一个 .doc 文件?
public ActionResult Download(int? Id)
{
string FileName = "Test";
var FilePath = Path.Combine(Path.GetTempPath(), "Temp.pdf");
Document UserPDF = new Document();
PdfWriter.GetInstance(UserPDF, new FileStream(FilePath, FileMode.Create));
CreateCv(UserPDF); // This is where the PDF is created
var fs = new FileStream(FilePath, FileMode.Open);
var Bytes = new byte[fs.Length];
fs.Read(Bytes, 0, (int)fs.Length);
fs.Close();
return File(Bytes, "application/pdf", FileName + ".pdf");
}
【问题讨论】:
标签: c# asp.net-mvc itextsharp