isPDFRenderingSupported Property

Summary

Checks if client-side PDF rendering is supported by the current platform.

Syntax
TypeScript
JavaScript
Object.defineProperty(DocumentViewer.prototype, 'isPDFRenderingSupported', 
	get: function() 
) 
static isPDFRenderingSupported: boolean; // read-only 

Property Value

true if client-side PDF rendering is supported by this document viewer instance; otherwise, false.

Remarks

This property will be true if the client-side PDF rendering javascript files and resources have been set up 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.

The 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. Also, 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. That way, the application will contain libs/pdfjs/Leadtools.Pdf.js, libs/pdfjs/Leadtools.Pdf.Worker.js, libs/pdfjs/Leadtools.Pdf.Compatibility.js, and the data files libs/pdfjs/cmaps/*.bcmap.

Add the following declaration in the head section of the HTML page:

// main pdf.js library 
<script type="text/javascript" src="libs/pdfjs/Leadtools.Pdf.js"></script> 
<script> 
// Point PDFJS in the direction of the worker file 
if (typeof PDFJS !== "undefined") { 
PDFJS.workerSrc = "libs/pdfjs/Leadtools.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/Leadtools.Pdf.Compatibility.js"></script> 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Document.Viewer Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.