I'm trying to show DWF files and PDF files natively without SVF translation. I'm following this blog here:
https://forge.autodesk.com/blog/dwf-and-pdf-support-forge-viewer
Starting with a PDF example, this is the code I'm using (suggested by Petr Broz in one of the stackoverflow posts)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/style.css">
<style>
body,
html {
margin: 0;
padding: 0;
height: 100vh;
}
#preview {
position: absolute;
width: 100%;
height: 100%;
}
</style>
<title>Autodesk Forge: PDF Demo</title>
</head>
<body>
<div id="preview"></div>
<script src="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/viewer3D.js"></script>
<script>
Autodesk.Viewing.Initializer({ accessToken: '' }, async function () {
const viewer = new Autodesk.Viewing.GuiViewer3D(document.getElementById('preview'));
viewer.start();
await viewer.loadExtension('Autodesk.PDF');
viewer.loadModel('https://developer.api.autodesk.com/oss/v2/signedresources/44b4af63-bd11-4a0f-8231-b1cbd14da3d9?region=US');
});
</script>
</body>
</html>
This line:
viewer.loadModel('https://developer.api.autodesk.com/oss/v2/signedresources/44b4af63-bd11-4a0f-8231-b1cbd14da3d9?region=US');
});
shows a signed url of a pdf file that resides in an oss bucket. Is this the correct way to pass the file to this method? because I'm getting the following errors:
Could you please suggest a solution?