@grapecity/gcpdfviewer
Version:
GcDocs PDF Viewer
36 lines (35 loc) • 1.57 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="theme-color" content="#000000" />
<title>GrapeCity Documents PDF Viewer Wasm Demo</title>
<script src="gcpdfviewer.js"></script>
<script async type="text/javascript" src="DsPdf.js"></script>
<script src="wasmSupportApiServer.js"></script>
<script>
function loadPdfViewer(selector) {
//GcPdfViewer.LicenseKey = 'your_license_key';
var viewer = new GcPdfViewer(selector, {
supportApi: {
implementation: new WasmSupportApi()
}
});
viewer.addDefaultPanels();
viewer.addAnnotationEditorPanel();
viewer.addFormEditorPanel();
// Below is an example of registering a font with its name and URL.
// This allows GcPdfViewer to use the registered font when viewing and editing PDFs.
// Note that the page must be served from a web server to load the font,
// because the file:// protocol does not allow font loading.
// Font name: 'CustomFont'
// URL: 'https://example.com/fonts/custom-font.ttf'
// viewer.registerFont('CustomFont', 'https://example.com/fonts/custom-font.ttf');
}
</script>
</head>
<body onload="loadPdfViewer('#root')">
<div id="root"></div>
</body>
</html>