Convert PDF to Word DOC or DOCX Programmatically in C#

Convert PDF to Word

In this article, I am going to demonstrate how to accurately and effortlessly convert PDF to Word document including conversion of PDF to DOC and PDF to DOCX formats. Earlier versions of Microsoft Word saved documents in binary format with .doc extension. With the release of Office 2007, Microsoft adopted the Office Open XML (OOXML) that is based on a combination of XML and binary files combined together as ZIP archives. MS Word now uses .docx as the default extension for saving documents.

The conversion of PDF to DOC and PDF to DOCX could be required in various scenarios. For example, you may want to make the PDF editable or you want to avoid retyping content of PDF into a Word document keeping the original formatting. Another use case could be the bulk PDF to DOC or DOCX conversions without any specialized software. Keeping an eye on such a scenario, this article covers the following PDF to Word conversion programmatically in C#:

  • Convert PDF to DOC in C#
  • Convert PDF to DOCX in C#
  • Convert PDF to DOC with additional settings

C# PDF to Word DOC or DOCX Converter

Aspose.PDF for .NET owns a powerful PDF to DOC or DOCX converter API that lets you convert PDF to Word documents in your .NET applications within a few lines of code. The API can be used in WinForms, ASP.NET, web services, or any .NET based application. You can either download the API or install it using the NuGet Package Manager in your project.

Convert PDF to DOC in C#

The following are the steps to convert PDF to DOC using Aspose.PDF for .NET.

The following code sample shows how to convert PDF to Word DOC using C#.

Convert PDF to DOCX in C#

Converting PDF to DOCX is similar to PDF to DOC conversion as shown earlier. The API has the DocSaveOptions class that allows you to set the document format to DOCX. The following are the steps to convert PDF to DOCX:

The following code sample shows how to convert a PDF to Word DOCX in C#.

Convert PDF to DOC with Additional Options

Aspose.PDF for .NET provides various other options to customize the PDF to DOC or DOCX conversion. The DocSaveOptions class exposes the properties to improve or enhance the PDF to DOC conversions, such as image resolution, the distance between lines, and etc. The following code shows how to set additional properties when converting PDF to DOC in C#.

Conclusion

In this article, you have learned some simple ways of converting PDF to DOC and PDF to DOCX using C#. If you want to know more about the powerful conversion features of Aspose.PDF for .NET then you can head-on to the API documentation section, Conversion of PDF to other formats. Download your free copy of Aspose.PDF for .NET and you can get started in no time by following the API documentation. If you have any queries, feel free to post to Aspose.PDF forum. We’ll be glad to assist you with your queries and inquiries.

See Also