Auto - the same image format as in the source PDF;
Jpeg to make the document size less;
PNG to keep the highest quality, but the highest size too.
using System;
using System.IO;
using SautinSoft.PdfFocus;
namespace Sample
{
class Sample
{
static void Main(string[] args)
{
string pdfFile = Path.GetFullPath(@"..\..\..\text and graphics.pdf");
string wordFile = "Result.docx";
SautinSoft.PdfFocus f = new SautinSoft.PdfFocus();
f.OpenPdf(pdfFile);
if (f.PageCount > 0)
{
f.WordOptions.Format = SautinSoft.PdfFocus.CWordOptions.eWordDocument.Docx;
int result = f.ToWord(wordFile);
if (result == 0)
{
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(wordFile) { UseShellExecute = true });
}
}
}
}
}
The PDF Focus .Net product includes a code example for converting a PDF document to a DOCX file. This example demonstrates how to use the library to programmatically convert a PDF file into a Word document (DOCX format).
The product supports various platforms, including Windows, Linux, macOS, and Docker, and is compatible with .NET 8, 7, 6, 5, Standard 2, Core 2x & 3x, and Framework 4.6.2+.