DOC Converter for .NET

Introduction to DOC Converter for .NET

The DOC Converter for .NET is a plugin that enables developers to convert PDF documents to Word file formats. This guide provides an overview of the available features and explains how to perform common tasks using code examples in .NET.

Converting Documents

The DOC Converter for .NET supports conversion of PDF documents to popular file formats such as Word documents. The following code example demonstrates how to convert a .pdf file to a .docx file:

var inputPath = Path.Combine(@"C:\Samples\", "sample.pdf");
var outputPath = Path.Combine(@"C:\Samples\", "sample.docx");

// Create an instance of the PdfDoc plugin.
var plugin = new PdfDoc();

// Create an instance of the PdfToDocOptions class.
var options = new PdfToDocOptions
{
    SaveFormat = SaveFormat.DocX
};

// Add the input and output file paths to the options.
options.AddInput(new FileDataSource(inputPath));
options.AddOutput(new FileDataSource(outputPath));

// Process the PDF to Word conversion using the plugin and options.
var resultContainer = plugin.Process(options);

// Get the result from the result container.
var result = resultContainer.ResultCollection[0];

// Print the result.
Console.WriteLine(result);

Supported File Formats

The DOC Converter for .NET supports the following input and output file formats:

  • Input: PDF
  • Output: DOC, DOCX

Best Practices and Troubleshooting

When using the DOC Converter for .NET, it’s good to follow best practices to ensure optimal performance and avoid common issues. Some tips include:

  • Use the correct file paths and names
  • Specify the correct input and output file formats
  • Customize conversion options as needed
 English