Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Document-Processing-toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@
<li>
<a href="/document-processing/data-extraction/net/conversions/pdf-to-markdown">PDF or Image to Markdown</a>
</li>
<li>
<a href="/document-processing/data-extraction/net/conversions/pdf-to-word">PDF or Image to Word</a>
</li>
</ul>
</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ The following assemblies need to be referenced in your application to extract da
</td>
<td>
Syncfusion.SmartDataExtractor.Base<br/>
Syncfusion.DocIO.Base<br/>
Syncfusion.Compression.Base<br/>
Syncfusion.ImagePreProcessor.Base<br/>
Syncfusion.OCRProcessor.Base<br/>
Expand All @@ -44,6 +45,7 @@ The following assemblies need to be referenced in your application to extract da
</td>
<td>
Syncfusion.SmartDataExtractor.Portable<br/>
Syncfusion.DocIO.Portable<br/>
Syncfusion.Compression.Portable<br/>
Syncfusion.ImagePreProcessor.Portable<br/>
Syncfusion.OCRProcessor.Portable<br/>
Expand All @@ -61,6 +63,7 @@ The following assemblies need to be referenced in your application to extract da
</td>
<td>
Syncfusion.SmartDataExtractor.NET<br/>
Syncfusion.DocIO.NET<br/>
Syncfusion.Compression.NET<br/>
Syncfusion.ImagePreProcessor.NET<br/>
Syncfusion.OCRProcessor.NET<br/>
Expand Down
112 changes: 112 additions & 0 deletions Document-Processing/Data-Extraction/NET/conversions/pdf-to-word.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
---
title: Convert PDF to Word in .NET Smart Data Extractor | Syncfusion
description: Convert PDF documents to Word using Smart Data Extractor. Transform PDF content into editable, structured Word documents in .NET.
platform: document-processing
control: SmartDataExtractor
documentation: UG
keywords: Assemblies
---

# Convert PDF to Word in .NET Smart Data Extractor

Word (DOCX) is a widely used format for creating and editing professional documents. The Syncfusion<sup>&reg;</sup> Smart Data Extractor library supports PDF to Word conversion in .NET, enabling seamless transformation of PDF files into fully editable Word documents while preserving the original layout, tables and images. This feature makes it easier to reuse content, improve accessibility, and integrate document data into downstream applications and business workflows.

## Assemblies and NuGet packages required

Refer to the following links for the assemblies and NuGet packages required based on your target platform to extract data as a Word file using the Syncfusion® Smart Data Extractor library.

* [PDF to Word Conversion assemblies](/document-processing/data-extraction/net/Assemblies-required)
* [PDF to Word Conversion NuGet packages](/document-processing/data-extraction/net/Nuget-packages-required)

## Convert PDF or Image to Word Document

To convert a PDF document or image into a Word using the **ExtractDataAsWordDocument** method of the [DataExtractor](https://help.syncfusion.com/cr/document-processing/Syncfusion.SmartDataExtractor.DataExtractor.html) class, refer to the following code example:

{% tabs %}

{% highlight c# tabtitle="C# [Cross-platform]" %}

using Syncfusion.SmartDataExtractor;
using Syncfusion.DocIO.DLS;

//Open the input PDF file as a stream.
using (FileStream stream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read))
{
//Initialize the Data Extractor.
DataExtractor extractor = new DataExtractor();
//Extract data as WordDocument.
WordDocument word = extractor.ExtractDataAsWordDocument(stream);
//Save the extracted Word data into an output file.
word.Save("Output.docx");
word.Close();
}

{% endhighlight %}

{% highlight c# tabtitle="C# [Windows-specific]" %}

using Syncfusion.SmartDataExtractor;
using Syncfusion.DocIO.DLS;

//Open the input PDF file as a stream.
using (FileStream stream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read))
{
//Initialize the Data Extractor.
DataExtractor extractor = new DataExtractor();
//Extract data as WordDocument.
WordDocument word = extractor.ExtractDataAsWordDocument(stream);
//Save the extracted Word data into an output file.
word.Save("Output.docx");
word.Close();
}

{% endhighlight %}

{% endtabs %}

N> If you want to convert an image instead of a PDF, replace the input stream with the image file (for example, Input.jpg or Input.png). The rest of the code remains unchanged.

## Convert PDF or Image to HTML Document

TTo convert a PDF document or image into HTML output using the **ExtractDataAsHtmlDocument** method of the [DataExtractor](https://help.syncfusion.com/cr/document-processing/Syncfusion.SmartDataExtractor.DataExtractor.html) class, refer to the following code example:

{% tabs %}

{% highlight c# tabtitle="C# [Cross-platform]" %}

using Syncfusion.SmartDataExtractor;

//Open the input PDF file as a stream.
using (FileStream stream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read))
{
//Initialize the Data Extractor.
DataExtractor extractor = new DataExtractor();
//Extract data as HTML.
string htmlContent = extractor.ExtractDataAsHtml(stream);
//Save the extracted HTML data into an output file.
File.WriteAllText("Output.html", htmlContent);
}

{% endhighlight %}

{% highlight c# tabtitle="C# [Windows-specific]" %}

using Syncfusion.SmartDataExtractor;

//Open the input PDF file as a stream.
using (FileStream stream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read))
{
//Initialize the Data Extractor.
DataExtractor extractor = new DataExtractor();
//Extract data as HTML.
string htmlContent = extractor.ExtractDataAsHtml(stream);
//Save the extracted HTML data into an output file.
File.WriteAllText("Output.html", htmlContent);
}

{% endhighlight %}

{% endtabs %}

N> If you want to convert an image instead of a PDF, replace the input stream with the image file (for example, Input.jpg or Input.png). The rest of the code remains unchanged.

Original file line number Diff line number Diff line change
Expand Up @@ -794,3 +794,51 @@ using (FileStream stream = new FileStream("Input.pdf", FileMode.Open, FileAccess
{% endtabs %}


## Barcode recognition

The Syncfusion<sup>&reg;</sup> Smart Data Extractor library enables barcode extraction from PDF documents and scanned images. The extracted barcode information is returned in JSON format, including properties such as Type, BarcodeType, Content, Threshold, and Bounds.

Additionally, when the output is extracted in Markdown format, barcodes are returned as Base64‑encoded image values, enabling easy rendering and storage of barcode images.

To recognize barcodes, use the following code snippet:

{% tabs %}

{% highlight c# tabtitle="C# [Cross-platform]" %}

using System.Text;
using Syncfusion.SmartDataExtractor;

//Open the input PDF file as a stream.
using (FileStream stream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read))
{
//Initialize the Data Extractor.
DataExtractor extractor = new DataExtractor();
//Extract data as JSON.
string data = extractor.ExtractDataAsJson(stream);
//Save the extracted JSON data into an output file.
File.WriteAllText("Output.json", data, Encoding.UTF8);
}

{% endhighlight %}

{% highlight c# tabtitle="C# [Windows-specific]" %}

using System.Text;
using Syncfusion.SmartDataExtractor;

//Open the input PDF file as a stream.
using (FileStream stream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read))
{
//Initialize the Data Extractor.
DataExtractor extractor = new DataExtractor();
//Extract data as JSON.
string data = extractor.ExtractDataAsJson(stream);
//Save the extracted JSON data into an output file.
File.WriteAllText("Output.json", data, Encoding.UTF8);
}

{% endhighlight %}

{% endtabs %}