XDoc.PDF
Features
Tech Specs
How-to C#
How-to VB.NET
Pricing
Convert PDF to Word (.docx)
Work with Other SDKs
Convert PDF to Microsoft Word (.docx)
  |  
Home ›› XDoc.PDF ›› C# PDF: Convert PDF to Word (.docx)

How to convert, make, turn Adobe PDF files to Microsoft Word (doc, docx) in C# using XDoc.PDF for .NET library


Online C#.NET Source Code for fast Converting PDF pages to Word (.doc/ .docx) Document with .NET XDoc.PDF Library on C# class, ASP.NET web forms (aspx), ajax, Azure, Sharepoint, WinForms, WPF




Best C#.NET PDF to Microsoft Office Word converter SDK for exporting PDF to Word in Visual Studio .NET


Support .NET WinForms, ASP.NET MVC in IIS, ASP.NET Ajax, Azure cloud service, DNN (DotNetNuke), SharePoint


High quality Library for converting PDF to Word in both .NET WinForms and ASP.NET application using C# programming language


Free .NET conversion control easy to be embedded to any .NET framework on Windows 32-bit and 64-bit without registration key


Quick to remove watermark and save PDF text, image, table, hyperlinks (url links), fillable forms and bookmark to Word without losing formatting


Powerful components for batch converting PDF documents in C#.NET program


Convert large PDF file size (larger than 10mb) to MS Office Word formats such as .doc and .docx, like Adobe Acrobat Pro


Working with OCR SDK, you can extract formatted text content from scanned PDF files in C#


Free online full trial download package to create editable Word file online or offline


Password protected PDF file can be printed to Word for mail merge


C# source code is available for copying and using in .NET Class


RasterEdge Visual C# .NET PDF to Word (DOC/DOCX) converter library control (XDoc.PDF) is a mature and effective PDF document converting utility. Using this PDF to Word converting library control, .NET developers can quickly convert PDF document to Word file using Visual C# code. This C#.NET PDF to Word(DOC/DOCX) conversion library can help developers convert multi-page PDF document to multi-page Word file or convert each PDF document page to separate Word file.


The most outstanding feature of this PDF to Word converting toolkit is its industry-leading converting accuracy. The Word file, converted by RasterEdge PDF to Word converter toolkit, preserves the structure & layout of target PDF document, keeps the elements (like images, tables and chats) of original PDF file and maintains the original text style (including font, size, color, links and boldness).


Why do we need this PDF to Word converting library? In the daily-life applications, you often need to use and edit PDF document content for certain purpose. But without licensed third-party software, you can hardly edit PDF document. Under this situation, you need to convert PDF document to some easily editable files like Word document.


RasterEdge XDoc.PDF empowers your C#.NET application with advanced PDF to Word conversion functionality. Microsoft Office Word 2003, 2007 and later versions are compatible with this product.




Quick to Start: C# create Word document from Adobe PDF file


Note: When you get the error "Could not load file or assembly 'RasterEdge.Imaging.Basic' or any other assembly or one of its dependencies. An attempt to load a program with an incorrect format", please check your configure as follows:

       

       If you are using x64 libraries/dlls, Right click the project -> Properties -> Build -> Platform target: x64.

       

       If using x86, the platform target should be x86.


This is a C# programming example for converting PDF to Word (.docx) file.



	    // file path to file path	
            String inputPath = @"C:\demo.pdf";
            String outputPath = @"C:\output.docx";
            PDFDocument doc = new PDFDocument(inputPath);
            doc.ConvertToDocument(DocumentType.DOCX, outputPath);


	    // stream to stream
            String inputPath = @"";
            byte[] arr = File.ReadAllBytes(inputPath);
            Stream inputStream = new MemoryStream(arr);
            PDFDocument doc = new PDFDocument(inputStream);
            Stream outputStream = new MemoryStream();
            doc.ConvertToDocument(DocumentType.DOCX, outputStream);




C# converting, changing two or multiple editable PDF files to Word documents (batch converter) in asp.net web forms, ajax, Winforms application





            String inputDirectory = "C:\input\";
            String outputDirectory = "C:\output\";
            String[] files = Directory.GetFiles(inputDirectory, "*.pdf");
            foreach (String filePath in files)
            {
                int startIdx = filePath.IndexOf("\\");
                int endIdx = filePath.IndexOf(".");
                String docName = filePath.Substring(startIdx + 1, endIdx - startIdx - 1);
                PDFDocument doc = new PDFDocument(filePath);
                doc.ConvertToDocument(DocumentType.DOCX, outputDirectory + docName + ".docx");
            }




C# creating word document from multiple pdf files combined, merged in asp.net





            String inputDirectory = @"C:\input\";
            String outputDirectory = @"C:\output\";
            String[] files = Directory.GetFiles(inputDirectory, "*.pdf");
            List<ConversionArgs> args = new List<ConversionArgs>();
            foreach (String filePath in files)
            {
                int startIdx = filePath.IndexOf("\\");
                int endIdx = filePath.IndexOf(".");
                String docName = filePath.Substring(startIdx + 1, endIdx - startIdx - 1);
                ConversionArgs arg = new ConversionArgs(filePath, outputDirectory + docName + ".docx");
                args.Add(arg);
            }

            List<Thread> threads = new List<Thread>();
            foreach (ConversionArgs arg in args)
            {
                Thread thread = new Thread(pdfToWordThread);
                thread.Start(arg);
            }
            foreach (Thread thread in threads)
            {
                thread.Join();
            }




.NET Class Namespace Required



Add necessary references:


  RasterEdge.Imaging.Basic.dll


  RasterEdge.Imaging.Basic.Codec.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.Imaging.Processing.dll


  RasterEdge.XImage.Raster.dll


  RasterEdge.XImage.Raster.Core.dll


  RasterEdge.XDoc.PDF.dll


  RasterEdge.XDoc.Office.Inner.Common.dll


  RasterEdge.XDoc.Office.Inner.Office03.dll


  RasterEdge.XDoc.Word.dll


Use corresponding namespaces;


  using RasterEdge.Imaging.Basic;


  using RasterEdge.XDoc.PDF;




public override void ConvertToDocument(DocumentType targetType, String filePath)

Description:
     Convert to DOCX/TIFF and save it on the disk.

Parameters:



public override void ConvertToDocument(DocumentType targetType, Stream stream)

Description:
     Convert to DOCX/TIFF and save it into stream.

Parameters:



public override void ConvertToDocument(DocumentType targetType, float zoomValue, String filePath)

Description:
     Convert to DOCX/TIFF with specified zoom value and save it on the disk.

Parameters:



public override void ConvertToDocument(DocumentType targetType, float zoomValue, Stream desStream)

Description:
     Convert to DOCX/TIFF with specified zoom value and save it into stream.

Parameters:



public override void ConvertToDocument(DocumentType targetType, int resolution, String filePath)

Description:
     Convert to DOCX/TIFF with specified resolution and save it on the disk.

Parameters:



public override void ConvertToDocument(DocumentType targetType, int resolution, Stream desStream)

Description:
     Convert to DOCX/TIFF with specified resolution and save it into stream.

Parameters:



public override void ConvertToDocument(DocumentType targetType, ImageCompress compression, String filePath)

Description:
     Convert to DOCX/TIFF with specified compression method and save it on the disk.

Parameters:



public override void ConvertToDocument(DocumentType targetType, ImageCompress compression, Stream desStream)

Description:
     Convert to DOCX/TIFF with specified resolution and save it into stream.

Parameters:



public override void ConvertToDocument(DocumentType targetType, string filePath, ImageOutputOption options)

Description:
     Convert to DOCX/TIFF with specified settings through options and save it on the disk.

Parameters:



public override void ConvertToDocument(DocumentType targetType, Stream desStream, ImageOutputOption options)

Description:
     Convert to DOCX/TIFF with specified resolution and save it into stream.

Parameters: