PDF 2 DOC,,,,PDF TO XLSX ,,,,,, PDF 2 PPT
1 INTRODUCTION TO FOXIT PDF CONVERSION SDK
Foxit PDF Conversion SDK is a flexible high-performance library to convert PDF files to MS office
suite formats while maintaining the layout and format of your original documents. It offers
advanced conversion capabilities as well as the same quality and user experience you can expect
from Foxit. The engine for creating MS office files is developed independently by Foxit and no 3rd
party office engine is required to be pre-installed on your machine. Foxit PDF Conversion SDK can be
used as a standalone library or as an add-on with Foxit PDF SDK.
1.1 Why Choose Foxit PDF Conversion SDK
Foxit is a leading software provider of solutions for reading, editing, creating, organizing, and
securing PDF documents. Foxit PDF SDK libraries have been used in many of today’s leading apps,
and are proven, robust, and battle-tested to provide the quality, performance, and features that the
industry’s largest apps demand. Foxit PDF Conversion SDK is a new SDK product independently
developed by Foxit. Customers choose Foxit PDF Conversion SDK for the following reasons:
• Easy to integrate
Developers can seamlessly integrate Foxit PDF Conversion SDK into their own applications.
• Lightweight footprint
Does not exhaust system resource and deploys quickly.
• Independently-developed engine
The core technology of the Conversion SDK is developed independently by Foxit.
• Premium World-side Support
Foxit offers premium support for its developer products because when you are developing mission
critical products you need the best support. Foxit has one of the PDF industry’s largest team of
support engineers. Updates are released on a regular basis to improve user experience by adding
new features and enhancements.
1.2 Foxit PDF Conversion SDK for Java
In this guide, we focus on the introduction of Foxit PDF Conversion SDK for Java API on Windows
platform. Foxit PDF Conversion SDK for Java API ships with simple-to-use APIs that can help Java
developers convert PDFs to office files (including Word/Excel/PowerPoint).
2
1.3 Evaluation
Foxit PDF Conversion SDK allows users to download a trial version to evaluate the SDK. The trial
version has no difference from a standard version except for the 14-day limitation trial period. After
the evaluation period expires, customers should contact Foxit sales team and purchase licenses to
continue using Foxit PDF Conversion SDK.
1.4 License
Developers should purchase licenses to use Foxit PDF Conversion SDK in their solutions. Licenses
grant users permissions to release their applications based on PDF SDK libraries. However, users are
prohibited to distribute any documents, sample codes, or source codes in the SDK released package
to any third party without the permission from Foxit Software Incorporated.
1.5 About this guide
This guide is intended for developers who need to integrate Foxit PDF Conversion SDK for Java into
their own applications. It aims at introducing installation package structure on desktop platform
with Java, and the usage of SDK.
3
2 GETTING STARTED
It is very easy to setup Foxit PDF Conversion SDK and see it in action! This guide will provide you with
a brief introduction about our SDK package. The following sections introduce the contents of system
requirements, the installation package as well as how to run a demo, and how to initialize Foxit PDF
Conversion SDK.
2.1 System Requirements
Note: Starting from version 1.1, Foxit PDF Conversion SDK supports machine learning-based
recognition functionality which can identify borderless tables in PDF documents. By default, it is
disabled, if you want to enable it, please make sure the network is connected first.
2.2 What is in the Package
In this guide, the highlighted rectangle in the figure is the version of the SDK. Here the SDK version is
1.2, so it shows 1_2.
Download the Foxit PDF Conversion SDK zip for Java API package and extract it to a new directory
"foxitpdfconversionsdk_1_2_win_java", which is shown in Figure 2-1. The release package contains
the following folders:
doc: API reference, developer guide
examples: sample demo
lib: libraries and license files
res: font-related configuration files
Platform System Requirement JDK version Note
Windows Windows Vista, 7, 8 and 10 (32-
bit and 64-bit)
Windows Server 2003, 2008
and 2012 (32-bit and 64-bit)
At least 1.8 It only supports for Windows
8/10 classic style, but not for
Store App or Universal App.
4
Figure 2-1
Note: In "res\metrics_data" folder, it contains the metrics data files which are used to simulate the
Office format document typesetting process during conversion.
2.3 How to run a demo
2.3.1 Run the demo using batch script
Foxit PDF Conversion SDK provides a pdf2office demo in the "examples" folder. To run this demo, go
to directory "\examples\simple_demo\pdf2office", and run the demo by "RunDemo.bat".
"\examples\simple_demo\input_files" contains the input files used in this demo. The output files
(Word, Excel, and Powerpoint) will be generated in the
"examples\simple_demo\output_files\pdf2office" folder.
2.3.2 Run a demo using Eclipse IDE
In order to reduce the size of the package, we did not provide the Eclipse project for the demo.
Therefore, if you want to run the demo in Eclipse IDE, you should do the steps below:
1) Create a Java project in Eclipse, and then integrate the SDK libraries into the project.
2) Copy the "pdf2office.java" file (under "\examples\simple_demo\pdf2office") to the "src"
folder of the project.
3) Open the Java file, modify the output_path and input_path path as your need. For example, if
you want to use the default test files in the code, you may need to use an absolute path
which points to the "output_files" and "input_files" folders in the "examples\simple_demo".
4) Run the demo. Right-click the project, choose Run As -> Java Application to run the project.
www.foxitsoftware.com
5
2.4 How to initialize Foxit PDF Conversion SDK
It is necessary for apps to initialize Foxit PDF Conversion SDK using a license before calling any APIs.
The trial license files can be found in the "lib" folder.
// Load the library.
// You can also use System.load("filename") instead. The filename argument must be an absolute path name.
static {
String os = System.getProperty("os.name");
if(os.toLowerCase().startsWith("win")){
if(System.getProperty("sun.arch.data.model").equals( "64")) {
System.loadLibrary("fpdfconversionsdk_java_win64");
} else {
System.loadLibrary("fpdfconversionsdk_java_win32");
}
}
}
// Initialize the library.
int error_code = Library.initialize("sn", "key");
if (error_code != e_ErrSuccess) {
return;
}
Note The value of "sn" can be got from "conversionsdk_sn.txt" (the string after "SN=") and the value of
"key" can be got from "conversionsdk_key.txt" (the string after "Sign=").