Client only

In this document
chevron_rightFull PDFTron API
chevron_rightBrowser support

Using WebViewer it's possible to view, edit and manipulate PDF and Office documents directly in the client without a conversion step on the server. WebViewer takes advantage of the latest browser technologies (for example WebAssembly) to render and manipulate documents completely on the client side.


Using the client only mode allows you to leverage the power of PDFTron rendering in the browser. Since no work is being done on the server this allows you to easily scale up the number of concurrent users without paying for more servers. The trade off is that a limited set of filetypes can be viewed (currently .pdf, .docx, .xlsx, .pptx, .md, .png, and .jpeg).


To instantiate WebViewer in client only mode simply pass the URL to a PDF or Office document to the initialDoc parameter and do not pass the pdftronServer option. Your license key is also required to be passed in.

var myWebViewer = new PDFTron.WebViewer({
  initialDoc: 'YOUR_FILE.pdf',
}, viewerElement);

linkFull PDFTron API

The full PDFTron API is also available on the client side and includes basically all of the native PDFTron API functions. This API can be used to process documents outside of the viewer as seen in these samples.

To enable this API when using the viewer pass in the fullAPI option to the WebViewer constructor. For example:

var myWebViewer = new PDFTron.WebViewer({
  initialDoc: 'YOUR_FILE.pdf',
  fullAPI: true
}, viewerElement);

The reason this option needs to be specified is because the scripts required to be downloaded for the full API are ~2-3 times larger than what is required for the viewer only. If you only want to view PDF documents and won't take advantage of the other PDFTron functions then you shouldn't pass the fullAPI option.

Samples using the full API along with the viewer can be found here. All guides for using the full API can be found here.

linkBrowser support

ChromeFirefoxSafariEdgeInternet ExplorerAndroid ChromeMobile Safari
*IE's JavaScript engine is slow compared to more modern browsers and this can impact performance