Skip to content

PDF to Office Sample: Configuration and Run Guide

Foxit PDF to Office (pdf2office) is an advanced conversion engine developed by Foxit. It can be integrated as a standalone SDK library or embedded seamlessly into Foxit PDF SDK as a plugin, providing developers with an efficient and accurate PDF to Office conversion solution.

This guide explains how to configure and run the Foxit pdf2office sample when invoked as a plugin. To learn how to call the related APIs and use this feature module, see PDF to Office.

To learn about using the pdf2office engine as a standalone SDK, see Explore Foxit Conversion SDK.

System Requirements

  • Platforms: Windows, Linux
  • Languages: C, C++, Java, Python, C#, Go
  • License: A license key that includes the PDF2Office module
  • SDK versions:
    • Foxit PDF SDK Windows C/C++/Java/Python/C# 9.0+
    • Foxit PDF SDK Linux C/C++/Java/Python/C# 9.1+
    • Foxit PDF SDK (Node.js) 10.0+
    • Foxit PDF SDK (Go) 11.0+

The versions above are the minimum SDK versions that first introduced the features described in this guide for each listed language. Refer to the package documentation and release notes for the latest versions and platform differences.

Obtaining PDF to Office Resource Files

Foxit PDF to Office supports two engine initialization methods:

  • Through the Foxit Conversion SDK DLL library
  • Through a binary executable

Therefore, two types of resource packages are available:

  • Foxit Conversion SDK package containing DLL libraries
  • Resource package containing binary executables

Choose the resource package that fits your needs. To obtain PDF to Office resource files, request a tria through the Foxit Developer Hub, or contact your Foxit technical support team and sales representatives.

Version Compatibility

When calling Foxit Conversion SDK features through Foxit PDF SDK, ensure the two SDK versions are compatible. The following table shows the version mapping:

Foxit PDF SDKFoxit Conversion SDK
v11.13.1
v11.03.0
v10.12.1
v10.02.0
v9.2+1.5
v9.0, v9.11.4

Sample Run Guide (Windows C++)

Sample location:

  • The pdf2office sample is located in the \examples\simple_demo\pdf2office directory. The configuration below uses the Windows C++ library as an example.

Configuration steps:

  1. Build the PDF2Office Resource Directory

Before running the pdf2office sample, extract the PDF2Office resource files to a specified directory and pass the engine file path under the lib folder to the PDF2Office.initialize API to initialize the PDF2Office engine.

  1. Configure the Sample

You can configure the pdf2office sample by editing \examples\simple_demo\pdf2office\pdf2office.cpp.

Specify the PDF2Office engine directory:

In pdf2office.cpp, add the pdf2office engine file path to initialize PDF to Office conversion.

cpp
WString library_path = L"";   //Please ensure the path is valid.
WString engine_path = L"";     //If you use engine to convert PDF to Office, please ensure the path is valid.
PDF2Office::Initialize(library_path, engine_path); //Please ensure the path is valid.
  1. Run the Sample

After configuration is complete, see Run Samples for instructions on running the sample.