David Siegert
David Siegert

Reputation: 1

How to view local drawing DWF file with correct font?

I am trying to view local dwf files in browser using forge viewer.

I followed this: https://aps.autodesk.com/blog/dwf-and-pdf-support-forge-viewer example to load local dwf file into the viewer.

let option = { env: "Local" };
        
        Autodesk.Viewing.Initializer(option, async function () {

            const viewer = new Autodesk.Viewing.GuiViewer3D(document.getElementById('forgeViewer'));
            viewer.start();
            viewer.setTheme('dark-theme');

            viewer.loadExtension('Autodesk.DWF').then(() => {
                console.log("Extension Loaded")
                console.log(path);
                try {
                    viewer.loadModel(virtualPath + path);
                } catch (e) {
                    console.log(e)
                    alert("Nepodařilo se načíst požadovaný soubor!")
                }
            });
        });

But there is a problem with font: forge-viewer-result

When I view the same file with "Autodesk Design Review" the font is correct: design-review-result

Detailed problems I have in my implementation of Forge Viewer:

Am I missing some sort of setting to the viewer?

Upvotes: 0

Views: 366

Answers (1)

Petr Broz
Petr Broz

Reputation: 9942

I don't think you're missing any settings. The native DWF loading in JavaScript is a relatively new feature, and there may be areas that require some polishing. If you wouldn't mind sharing one of the DWFs with us (confidentially via forge (dot) help (at) autodesk (dot) com; the file would not be shared with anyone outside of Autodesk), we can ask the viewer engineering team to look at it.

In the meantime, have you tried converting the DWF into the viewer format using the Model Derivative service? While this operation has some cost (0.1 flex tokens per DWF), it uses AutoCAD to process the DWF, so it is generally more robust.

Upvotes: 0

Related Questions