We are excited to announce that WebViewer Server is now available as a Cloudformation template for AWS. It provides a turn-key backend for viewing and annotating 30+ file formats inside web apps. Deploying from the template lowers development costs and allows you to go-to-market faster by providing an optimized AWS-based document rendering backend right out-of-the-box. You can download it here.

It also offers built-in auto-scaling for a WebViewer Server solution that requires less resources, ensuring high availability during sudden activity spikes.


The Cloudformation template is a blueprint for an AWS server architecture that can be deployed with a click. The template uses our existing DockerHub images and other inline tooling to provide the ideal experience for your WebViewer Server. The template also allows configuration during the deployment phase, and can be easily adjusted to fit your needs.


The system is largely based in the Elastic Container Service (ECS), and takes full advantage of its ability to maintain high availability of the system. By using ECS and our key performance metrics, we are able to dynamically spin up new containers when server load is high (with no downtime), and then dynamically scale back down when the load is no longer present. This provides higher availability at a lower total cost of ownership.

Managing Containers

The AWS Load Balancer acts as a point of entry for all traffic to the backend. It monitors the health of all servers in the HAProxy cluster so it can redirect traffic to these internal balancers without issue.

The HAProxy cluster includes all containers used for internal load balancing. Traffic from the AWS Load Balancer comes here first, after which it is redirected to the appropriate WebViewer server based on the health of the servers in the cluster, and the user’s prior usage of the backend.

The WebViewer Server (PDF) cluster contains all containers for the WebViewer Server. Document rendering and processing occurs on these containers.

The Performance Monitoring Lambda and Service Discovery Lambda functions handle WebViewer Server discovery for the HAProxy cluster, decisions on auto-scaling, and system health.

These systems all work in tandem to offer your users a fast and seamless experience. The diagram below details how all these systems work together. You can read more about it from our documentation.

AWS CloudFormation Stack

Performance Metrics

Performance metrics for tracking how long jobs take to execute on the server queues are executed through a series of staggered probes on each node, which are continuously monitored. When these metrics exceed an acceptable level, we call the Elastic Container Service and request a horizontal scale. Within moments, a new container is created and the load is relieved with no downtime.


The entire network is kept within a private VPC and only whitelisted servers are allowed to communicate. The only entry point is the front facing load balancer, which can support both HTTP and HTTPS.

Centralized Logging

All logs from the ECS containers are forwarded to a single log group, enabling easy collection and analysis. With a few tweaks, it's even possible to redirect all these logs to the log driver of your choice.

Getting Started

After downloading the template, it takes only a few clicks to finish the build process. Once it's up and running, you just need to point your WebViewer based application at the public DNS address of the AWS load balancer. We have provided a guide on the setup process for WebViewer Server on AWS.

This can be done by modifying the pdftronServer option shown below to the proper address.

options.pdftronServer = 'http://<HOST_IP_ADDRESS or localhost>:8090/';
var myWebViewer = new PDFTron.WebViewer(options, viewerElement);

See It In Action

Check out our WebViewer Demo, which uses this CloudFormation template.