Yes like Erop said. You can use the Microsoft Word 14.0 Object Library
. Then it's really easy to convert from doc to docx. E.g with a function like this:
public void ConvertDocToDocx(string path)
{
Application word = new Application();
if (path.ToLower().EndsWith(".doc"))
{
var sourceFile = new FileInfo(path);
var document = word.Documents.Open(sourceFile.FullName);
string newFileName = sourceFile.FullName.Replace(".doc", ".docx");
document.SaveAs2(newFileName,WdSaveFormat.wdFormatXMLDocument,
CompatibilityMode: WdCompatibilityMode.wdWord2010);
word.ActiveDocument.Close();
word.Quit();
File.Delete(path);
}
}
Make sure to add CompatibilityMode: WdCompatibilityMode.wdWord2010
otherwise the file will stay in compatibility mode. And also make sure that Microsoft Office is installed on the machine where you want to run the application.
Another thing, I don't know PDFFocus.net
but have you tried converting directly from pdf to docx. Like this:
static void main(String[] args)
{
SautinSoft.PdfFocus f=new SautinSoft.PdfFocus();
f.OpenPdf(@"E:\input.pdf");
t.ToWord(@"E:\input.docx");
}
I would assume that this is working, but it's only an assumption.