Skip to content

Foxit PDF SDK Java Library

This section describes how to use the Foxit PDF SDK Java library to run examples and create a basic Java project. The project demonstrates rendering the first page of a PDF document to a bitmap and saving it as a JPG image.

Prerequisites

Development environment

  • JDK ≥ 1.8:ensure JAVA_HOME is configured correctly and the JDK bin directory is on your PATH.
  • Foxit PDF SDK Java library: Request a trial via the Foxit Developer Hub. Download and install the library that matches your OS and architecture.

Supported platforms

We provide detailed system support information for Windows, Linux, and Mac, including operating system versions and compiler requirements. Select your platform for details.

Windows Linux Mac

Running examples

Running examples from the command line

See Examples, which includes an overview of the sample projects, dependency information for specific examples, and how to run examples from the command line.

Running examples in Eclipse IDE

To keep the release package size small, Foxit does not include Eclipse sample projects. To run examples in Eclipse IDE, follow these steps:

  1. Create a Java project in Eclipse, then follow steps 1) and 3) under Creating a project in Eclipse IDE below to integrate the SDK library into the project.
  2. Copy the Java file for the example you want to run into the project. For example, for the image2pdf demo, copy image2pdf.java from the \examples\simple_demo\image2pdf directory into the project's src folder.
  3. Open the Java file and update the output_path and input_path as needed. For example, if you use the default test files referenced in the code, use absolute paths pointing to the output_files and input_files folders under the examples\simple_demo directory.
  4. Run the example. Right-click the project and select Run As → Java Application.