Forge Viewer, loading pdf with setting LMV_VECTOR_PD to true, give different result when using Autdesk.Edit2D, Autodesk.Measure

54 views Asked by At

First Image I used Autodesk.Measure, second one I used Autodesk.Edit2D, this only happen for some Pdfs that are exported as a pdf from Revit If I removed this line LMV_VECTOR_PDF = true; the measure and edit2D will give same result after use calibrate tool but removing this line affect badly on zoom, I need too much zoom in/out

This is my code

` LMV_VECTOR_PDF = true; Autodesk.Viewing.Initializer(options, () => { this.viewer.start(); Autodesk.Viewing.Document.load(this.URN, onDocumentLoadSuccess, onDocumentLoadFailure); });

  const onDocumentLoadSuccess = ( doc:any ) => {
    const defaultModel = doc.getRoot().getDefaultGeometry();
    viewer.loadDocumentNode(doc, defaultModel);
    viewer.loadExtension( 'Autodesk.PDF' );

    Autodesk.Viewing.theExtensionManager.registerExtension('Edit2dExtension', Edit2dExtension);
    this.viewer.loadExtension('Edit2dExtension').then((edit2d: any) => {
    });

    this.viewer.loadExtension('Autodesk.Edit2D').then((edit2d: any) => {
      this.edit2d = edit2d;
      this.layer = edit2d.defaultContext.layer;
      this.tools = edit2d.defaultTools;

  }

  function onDocumentLoadFailure(viewerErrorCode:any) {
    console.error('onDocumentLoadFailure() - errorCode:' + viewerErrorCode);
  }`

[enter image descriptenter image description hereion here](https://i.stack.imgur.com/UxqC8.png)

I tried using Removing it and worked but as I mentioned it affect on zooming;

1

There are 1 answers

0
Adam Nagy On

There can be a discrepancy between loading the PDF as leaflets or native PDF: https://aps.autodesk.com/blog/markups-leafletloader-vs-pdfloader

There is a way you might be able to automate the calibration of the measure tool: https://aps.autodesk.com/blog/calibrate-measure-tool-other-units

Please provide a PDF either here on stackoverflow or via "Contact support" button on https://aps.autodesk.com/get-help
Then we could investigate why the measure tool does not work correctly with that specific PDF