【发布时间】:2016-03-10 17:23:04
【问题描述】:
我使用 PDFFocus.net dll 将 PDF 文件转换为 word 文件。但对于我的系统,我想要 .docx 文件。我尝试了不同的方法。有一些可用的库。但那些不是免费的。这是我的 pdf 到 doc 转换代码。
Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Text;
Using System.Threading.Tasks;
Using iTextSharp.text;
Using iTextSharp.text.pdf;
namespace ConsoleApplication
{
class Program
{
static void main(String[] args)
{
SautinSoft.PdfFocus f=new SautinSoft.PdfFocus();
f.OpenPdf(@"E:\input.pdf");
t.ToWord(@"E:\input.doc");
}
}
}
这项工作成功。 然后我尝试使用下面的代码将 .doc 转换为 .docx。但它给了我错误。
//Open a Document.
Document doc=new Document("input.doc");
//Save Document.
doc.save("output.docx");
谁能帮帮我。
【问题讨论】:
-
像 Gembox.Document 或 SpireDoc.NET Free 这样的库可能会有所帮助 - 加载
.doc并另存为.docx -
基于对documentation 的快速浏览,没有迹象表明PDFFocus 支持RTF 输出以外的任何内容(即使使用
.doc文件扩展名)。你确定它可以生成基于 Open XML 的 Word 格式 (.docx)?
标签: c#