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 SDK | Foxit Conversion SDK |
|---|---|
| v11.1 | 3.1 |
| v11.0 | 3.0 |
| v10.1 | 2.1 |
| v10.0 | 2.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
office2pdfsample is located in the\examples\simple_demo\office2pdfdirectory. The configuration below uses Windows C++ as an example.
Configuration steps:
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
\libdirectory in the resource package and data files from theres\office2pdfdirectory.
Configure the sample:
Edit
\examples\simple_demo\pdf2office\office2pdf.cppto configure the sample.Configure library files:
- Based on your CPU architecture, set the
engine_pathparameter to the full path of the corresponding dynamic library file (win32.dllorwin64.dll) in the\libdirectory 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);- Based on your CPU architecture, set the
Specify resource data:
- Set the
office2pdf_setting_data.resource_folder_pathparameter to the full path of theres\office2pdfdirectory in the resource package.
c++office2pdf_setting_data.resource_folder_path = L"path/res/office2pdf";- Set the
Run the sample:
- After configuration is complete, see Run Samples for instructions on running the sample.