XDoc.Word
Features
Tech Specs
How-to C#
Pricing

C# Word Library
How to C#: Convert PDF, Excel, PPT to Word


Online C# Tutorial for Converting PDF, MS-Excel, MS-PPT to Word





By integrating XDoc.Word SDK into your C#.NET project, PDF, MS-Excel and MS-PPT can be converted to Word document. Generally speaking, following conversion types are supported.

  • From PDF to Word
  • From MS-XLS and MS-XLSX to Word
  • From MS-PPT and MS-PPTX to Word


How to C#: Convert PDF to Word



Following is C# demo code for PDF (.pdf) to Word conversion.

String inputFilePath = Program.RootPath + "\\" + "1.pdf";
String outputFilePath = Program.RootPath + "\\" + "Output.docx";

// Load a PDF document.
PDFDocument doc = new PDFDocument(inputFilePath);

// Convert it to Word document.
doc.ConvertToDocument(DocumentType.DOCX, outputFilePath);


How to C#: Convert Excel to Word



This is a C# class example for Excel (.xlsx) to Word conversion.

String inputFilePath = Program.RootPath + "\\" + "1.xlsx";
String outputFilePath = Program.RootPath + "\\" + "Output.docx";

// Load an Excel (.xlsx) file.
XLSXDocument doc = new XLSXDocument(inputFilePath);

// Convert Excel to Word.
doc.ConvertToDocument(DocumentType.DOCX, outputFilePath);


How to C#: Convert PPT to Word



Following sample code may help you with converting PowerPoint to Word file.

// Used to register all DLL assemblies.
WorkRegistry.Reset();

String inputFilePath = Program.RootPath + "\\" + "1.pptx";
String outputFilePath = Program.RootPath + "\\" + "Output.docx";

// Load a PowerPoint (.pptx) file.
PPTXDocument doc = new PPTXDocument(inputFilePath);

// Convert it to a Word.
doc.ConvertToDocument(DocumentType.DOCX, outputFilePath);