Skip to content

Foxit Office to PDF Sample: Configuration and Run Guide

Foxit Office to PDF (office2pdf) is an advanced conversion engine developed by Foxit. It can be used as a standalone SDK library or integrated as a plugin into Foxit PDF SDK to extend SDK use cases.

This guide explains how to configure and run the Foxit office2pdf sample when invoked as a plugin. To learn how to call this feature through the API, see Office to PDF.

To learn more about using office2pdf as a standalone SDK, see Explore Foxit Conversion SDK.

System Requirements

Platforms: Windows, Linux
Languages: C, C++, Python, Java, C#, Node.js, Go
License: A license key that includes the Office2PDF module
SDK versions:

  • Foxit PDF SDK for Windows 10.1.0+
  • Foxit PDF SDK for Linux 11.0.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.

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

Obtaining Office to PDF Resources

When invoked as a Foxit PDF SDK plugin, Foxit's proprietary Office to PDF can use the Foxit Conversion SDK package directly. Request a trial through the Foxit Developer Hub, or contact your Foxit technical support team and sales representatives to obtain the latest Foxit Conversion SDK resource package.

Sample Run Guide (Windows C++)

Sample location:

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

Configuration steps:

  1. Build the office2pdf resource directory:

    • Extract the Foxit Conversion SDK resource package to a specified directory.
    • For the extracted directory structure, see Foxit Conversion SDK — Package Structure.
    • This sample configuration uses DLL library files from the \lib directory in the resource package and data files from the res\office2pdf directory.
  2. Configure the sample:

    • Edit \examples\simple_demo\pdf2office\office2pdf.cpp to configure the sample.

    • Configure library files:

      • Based on your CPU architecture, set the engine_path parameter to the full path of the corresponding dynamic library file (win32.dll or win64.dll) in the \lib directory of the resource package.
      c++
      WString engine_path = L"path/lib/fpdfconversionsdk_win64.dll"; // 请替换为正确的引擎路径。
      foxit::addon::conversion::Convert::FromWord(word_file_path, L"", output_path, engine_path, word_convert_setting_data);
    • Specify resource data:

      • Set the office2pdf_setting_data.resource_folder_path parameter to the full path of the res\office2pdf directory in the resource package.
      c++
      office2pdf_setting_data.resource_folder_path = L"path/res/office2pdf";
  3. Run the sample:

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