Is there a maximum time to view that we can provide our stakeholders?

Skip to first unread message

Ryan - PDFNet Developer

Sep 16, 2016, 2:54:40 PM9/16/16
to PDFTron WebViewer

We are using PDF WebViewer, and our stakeholders are asking that it takes "not more than 4 seconds to load and display a file". 


Since we are talking about a client/server relationship here, the main factor is the network latency. If the client and server are on different networks, then there is very little that can be assumed about the latency between those two points. For example, if a client is at a coffee shop, on another continent.

If your clients are all on the same network (e.g. the server and clients are all in the same office building) then you can be more confident in latency.

As for PDF WebViewer specifics, as everything above is general networking, there are three main things that could cause slow loading.

1. First time client uses PDF WebViewer. There is some delay while PDFNetJS gets downloaded. Once downloaded, it is cached, so next time client uses WebViewer this initial download will not occur (unless you updated PDFNetJS on the server). Note, this is why we offer two versions of PDFNetJS. Lean (default) and Full. If you just want to support viewing and annotating a PDF in the browser, then use Lean, which is a smaller file size. If you need the full SDK (say you want to digitally sign the PDF) then you need the larger Full version. Again though, this is just a first time download, and for updates. Rest of time, browser should use cached one already downloaded.

2. Your server, hosting the PDF file, should support byte range request headers. Otherwise, the entire file must be downloaded before it can be viewed.

3. PDF files should be saved as Linearized (also known as Fast Web View). Otherwise, again the entire file must be downloaded. Fortunately, most files these days are saved this way, but not all. This is not a PDFNet limitation, but a limitation of older (non-linearized) PDF file format that pre-dates the modern web, and viewing over a network, which Linearized PDF files are designed for.

For points 2 and 3, the time for a full download depends on the size of the PDF, and your network bandwidth, both of which are outside of PDFNetJS's control.

Of course, if the user is loading a local PDF file, then points 2 and 3 can essentially be ignored, as load times will be order of magnitude faster, than over a network.

So while we designed WebViewer and PDFNetJS to be as fast as possible, we cannot make any promises on load times, as some factors are completely out of our control.
Reply all
Reply to author
0 new messages