Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
82 lines (66 sloc) 2.32 KB
<!DOCTYPE html>
<html>
<head>
<title>PDF Leaflet Image Viewer</title>
<link rel="icon" type="image/png" href="favicon.png">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=no" />
<meta charset="utf-8">
<style>
.test-padding {
left: 10%;
top: 50px;
width: 80%;
height: 400px;
position: relative;
}
</style>
<link rel="stylesheet" href="style.min.css" type="text/css">
<link rel="stylesheet" href="./extensions/Markups/MarkupsGui.css" type="text/css">
<script src="three.min.js"></script>
<script src="wgs.min.js"></script>
<script src="viewer3D.min.js"></script>
<script src="./extensions/Markups/Markups.min.js"></script>
<script src="./extensions/Markups/MarkupsGui.min.js"></script>
</head>
<body onload="initializeViewer();" style="margin:0">
<div id="forgeViewer" style="margin:0">
</div>
</body>
<script>
var szInput = ( location.hash.slice(1) || "sheet1" );
var documentId = `./pdf-imageviewer/${szInput}/bubble.json`;
var viewer;
function initializeViewer() {
viewer = new Autodesk.Viewing.Private.GuiViewer3D(document.getElementById('forgeViewer'), {});
var options = {
env: "Local",
useADP: false,
documentId: documentId
}
function onLoadSuccess() {
console.log('on success');
viewer.loadExtension("Autodesk.Viewing.MarkupsCore")
viewer.loadExtension("Autodesk.Viewing.MarkupsGui")
}
Autodesk.Viewing.Initializer( options, function() {
viewer.start();
Autodesk.Viewing.Document.load(documentId,
function( document, errorsandwarnings ) {
var geometryItems = Autodesk.Viewing.Document.getSubItemsWithProperties(document.getRootItem(), {'type':'geometry', 'role':'2d'}, true);
if(geometryItems.length > 0) {
var loadOptions = {};
var path = document.getViewablePath(geometryItems[0], loadOptions);
viewer.load(path, null, onLoadSuccess, null, document.acmSessionId, loadOptions);
}
}
)
});
function onfail(e) {
console.log('fail');
}
function onSuccess() {
console.log('ready');
}
}
</script>
</html>