Foxit PDF SDK for Web

Quick Start Guide for PDF SDK for Web

Foxit PDF SDK For Web is a client-side rendering, no back-end service and lightweight web-based SDK. It was developed to be easily and quickly embedded into web applications. This article will describe how to easily set up the web viewer using Nginx and Tomcat as the HTTP service.

Nginx Configuration

Using Windows as an example, you can download the latest version of Nginx and follow the instructions on their online guide. When you have Nginx server running, you can unzip PDF SDK for Web’s package to a location of your choice in your computer, in this example we will add to ‘D:/ FoxitPDFSDKForWeb_6_x’. You can directly modify the nginx.conf in the conf directory, here we directly write a configuration file, create a new ‘webpdf.conf‘ file inside D:/ FoxitPDFSDKForWeb_6_x and write the following code in it:

server{
         listen 8080;
         server_name 127.0.0.1;
         location / {
                   alias  "D:/FoxitPDFSDKForWeb_6_x/";
                   charset utf8;
                   }
}

Save it and reload Nginx by entering localhost:8080 in browser.

Tomcat Configuration

The Tomcat server is a free open source web application server. It is a lightweight application server. It is widely used in small and medium-sized systems and concurrent access users. It is the first choice for developing and debugging JSP programs. Install Tomcat and follow the instructions in their online tutorial.

If you do not want to modify the configuration file, you may put the extracted SDK package into webapps\ROOT in the installation directory. If index.html is not in the ROOT directory, you need to configure WebPDF.ready second in scripts/control/pc/demo.js. Add a baseUrl configuration to the optionsParam parameter, as shown in the image below:

Or you can modify Tomcat’s conf/server.xml file in the installation directory, pointing to the directory where index.html is located, as the image below:

Then, you can access it by typing localhost:8080 in the browser.

Updated on August 16, 2021

Was this article helpful?
Thanks for your feedback. If you have a comment on how to improve the article, you can write it here: