Is it possible to preload WebViewer in the background to speed up the time it takes to load a document the first time? I also want to load multiple documents which might have a different documentId and server URL.
In the WebViewer showcase you can see an example of preloading the viewer so that it's ready immediately if you choose to open a PDF file. To do this you can initialize WebViewer like normal but add a "hidden" class to the viewerElement that WebViewer is being initialized with. The hidden class should look like this:
.hidden {
width: 0 !important;
height: 0 !important;
}
The reason you do this instead of display:none is because there is an issue in Firefox with using display: none.
When you want to show WebViewer you remove the hidden class on the element and then call myWebViewer.loadDocument to load a particular document.