Skip to content
ComPDF
DemoFAQ
New Release

Open-Source PDF SDK & AI Document Processing

Get the full self-hosted SDK and AI document processing on GitHub. One-click deploy to quickly build your document workflows.

Convert PDF to Word

Overview

Converting PDF to Word is an operation that converts the PDF format file into a editing Word format file. By converting PDF to Word, you can easily edit, modify, insert, or delete text and pictures, adjust layout and properties.

Layout differences

  • Word's Streaming Layout: Ideal for editing, with your editing, the content dynamically adapts to different positions. However, a Word file would display differently due to the incompatibility of various software or app versions. It makes it unsuitable for precise documentation like electronic files or certificates.

  • PDF's Fixed Page Layout: Ensures a stable, uniform appearance and print quality across all devices. The content and formatting are locked upon creation, making alterations difficult without affecting the overall layout. It's preferred for formal documentation such as business reports and official electronic records.

Sample

This sample demonstrates how to convert from a PDF to DOCX file.

c++
ConvertOptions opt;
// Set Reserved page layout.
opt.page_layout_mode = PageLayoutMode::e_Box;
CPDFConversion::StartPDFToWord("word.pdf", "password", "path/output.docx", opt);

// Set Streaming layout.
opt.page_layout_mode = PageLayoutMode::e_Flow;
CPDFConversion::StartPDFToWord("word.pdf", "password", "path/output.docx", opt);

Convert Formulas to Images

When a document contains complex formulas and you want to preserve visual consistency in the output document, you can enable the formula_to_image option.

c++
ConvertOptions opt;
opt.formula_to_image = true;
CPDFConversion::StartPDFToWord("word.pdf", "password", "path/output.docx", opt);