Convert PDF to MS Office (Word, Excel, PowerPoint) in C++

Convert PDFs to MS Office (DOCX, XLSX, PPTX) without any external third party dependencies. PDF to Word, PDF to Excel, PDF to PowerPoint are all provided with support for C#, Python, C++, Java, PHP, Ruby, Go; on Windows, Linux and Mac.

The Structured Output module is an optional add-on

Only available on Desktop and Server (Windows, Linux, or Mac) You can find more details about how to install the Structured Output module here .

Setup

  1. Download the Structured Output Module that allows PDF to Office conversion.
  2. Place it in the directory of your project, in a folder called lib and then reference it in the below sample.

Convert PDF to Word

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

1Convert::WordOutputOptions wordOutputOptions;
2// Optionally convert only the first page
3wordOutputOptions.SetPages(1, 1);
4// Requires the Structured Output module
5Convert::ToWord(filename, output_filename, wordOutputOptions);

Convert PDF to PowerPoint

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

1Convert::PowerPointOutputOptions powerPointOutputOptions;
2// Optionally convert only the first page
3powerPointOutputOptions.SetPages(1, 1);
4// Requires the Structured Output module
5Convert::ToPowerPoint(filename, output_filename, powerPointOutputOptions);

Convert PDF to Excel

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

1Convert::ExcelOutputOptions excelOutputOptions;
2// Optionally convert only the first page
3excelOutputOptions.SetPages(1, 1);
4// Requires the Structured Output module
5Convert::ToExcel(filename, output_filename, excelOutputOptions);

Full Sample Code

Convert PDF files to MS Office
Full sample code which illustrates how to convert PDF to MS Office files (Word, Excel, PowerPoint). Code sample is available in C++, C#, Java, Python, Go, PHP, Ruby & VB.

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales