Checks if client-side PDF rendering is supported by the current platform.
Object.defineProperty(DocumentViewer.prototype, 'isPDFRenderingSupported',
get: function()
)
static isPDFRenderingSupported: boolean; // read-only
true if client-side PDF rendering is supported by this document viewer instance; otherwise, false.
This property will be true if the client-side PDF rendering javascript files and resource have been setup correctly in the HTML page. Refer to Files to be Included with your Application.
Note that client-side PDF rendering is not supported in Desktop Internet Explorer 9 or any mobile versions of Internet Explorer.
Client-side PDF rendering uses a customized and highly optimized version of the popular Mozilla PDF.js library. Refer to https://mozilla.github.io/pdf.js/ for more information.
User-application must set up the library prior to use as follows:
Assume that index.html
is the HTML page using the document viewer that resides in the root folder of the application. And assume that
libs
is the name of the folder under the root holding 3rd party js files. Copy the pdfjs
folder described in the topic above to
and put it inside libs
. So that your application will contain libs/pdfjs/lt.pdf.js
, libs/pdfjs/lt.pdf.worker.js
,
libs/pdfjs/lt.pdf.compatibility.js
and the data files libs/pdfjs/cmaps/*.bcmap
.
Add the following decleration in the head
section of your HTML page:
// main pdf.js library
<script type="text/javascript" src="libs/pdfjs/lt.pdf.js"></script>
<script>
// Point PDFJS in the direction of the worker file
if (typeof PDFJS !== "undefined") {
PDFJS.workerSrc = "libs/pdfjs/lt.pdf.worker.js";
// cmap URL is relative to the PDF Rendering location
// ensure your server hosts cmap files (.bcmap)
PDFJS.cMapUrl = "libs/pdfjs/cmaps";
PDFJS.cMapPacked = true;
}
</script>
>script type="text/javascript" src="libs/pdfjs/lt.pdf.compatibility.js"></script>
Products |
Support |
Feedback: isPDFRenderingSupported Property (DocumentViewer) - Leadtools.Documents.UI |
Introduction |
Help Version 19.0.2017.3.21
|