For the complete documentation index, see llms.txt. This page is also available as Markdown.

Modifying WebViewer Server

It's possible to perform internal changes to WebViewer Server, though we do not recommend it. You may wish to do this if our options do not expose a particular configuration setting, such as the maximum allowed threads in Tomcat.

WebViewer Server Layout

This section will help you understand WebViewer Server. Below is how you would typically build on top of our existing container.

FROM pdftron/webviewer-server:latest
COPY myfile.txt /
docker build -t webviewer .
docker run webviewer

The important paths within the server image are as follows:

  • /home/apryse: This is the server which hosts the WebViewer Server code; it's where the bulk of work occurs.

  • /home/apryse/wv-server/static_data: This is where we store WebViewer Server's cache.

  • /home/apryse/wv-server/internal_data/: Where temporary data is stored, mainly used by Apryse core for memory swaps.

  • /home/apryse/wv-server/webapps: This contains the blackbox and demo webapps. Prior to 1.5.6 this will contain Java classes, in any other version it will contain .war files containing the webapps.

  • /home/apryse/wv-server/logs: Contains all logging data for WebViewer Server.

When WebViewer Server starts, it executes a script located in /home/apryse/watchdog.sh, this file is responsible for keeping Tomcat running inside of the container.

Modifying JAVA_OPTS

Some customers may need to modify JAVA_OPTS, most likely to change memory values. This can be easily done by setting the JAVA_OPTS environment variable. Keep in mind the following must be in the JAVA_OPTS variable.

In the docker-compose this would be defined like so:

Java Memory

The main use for this is to modify Java memory limits. We recommend setting Xmx to a bit less than your server's available memory. This will prevent Java from exceeding allocation limits because it has not garbage collected.

The following documentation details more about these java options.

Adding TTF and OTF Fonts

Adding custom TTF and OTF fonts to WebViewer Server is easy, although how to do so depends on how you are running it.

When Running in a Container

Without Rebuilding

It is possible to add TTF and OTF fonts to WebViewer Server without rebuilding its container. To do so, mount your custom fonts as a volume to /home/tomcat/.fonts/custom. This can be done with docker-compose, as shown with the following line:

You can replace ./myfonts with whatever path contains your fonts.

Alternatively, this can also be done when running directly through Docker, like so:

Similarly, /home/user/myfonts is a stand-in for the path to your fonts. Also, you should run your Docker setup with a clean start before you mount a volume.

With Rebuilding

You can also add TTF and OTF fonts by modifying the container image. You can replace myfonts/ with whatever path contains your fonts.

When Installed with the Windows Installer

On Windows, you should install TTF and OTF fonts directly onto your system, and then restart WebViewer Server. This guide from Microsoft goes into more detail on how this is done.

Adding Other Types of Fonts

If a module you are running supports other types of fonts, such as SHX and RTF fonts for the CAD Module, it possible to add your own custom fonts for those modules to WebViewer Server.

When Running in a Container

Without Rebuilding

To add module-specific fonts to WebViewer Server without rebuilding its container, mount your custom fonts as a volume to /usr/local/apache-tomcat/fonts. This can be done with docker-compose, as shown with the following line:

You can replace ./myfonts with whatever path contains your fonts.

Alternatively, this can also be done when running directly through Docker, like so:

Similarly, /home/user/myfonts is a stand-in for the path to your fonts. Also, you should run your Docker setup with a clean start before you mount a volume.

With Rebuilding

You can also add module-specific fonts to WebViewer Server by modifying its container image. myfonts/ can be replaced with whatever path contains your custom fonts.

When Installed with the Windows Installer

You must manually add module-specific fonts within your WebViewer Server directory on Windows. You can add your custom fonts to \WebViewer-Server\apache-tomcat\fonts, where \WebViewer-Server is your root directory for WebViewer Server. You may need to create the \fonts folder yourself.

Last updated

Was this helpful?