flutterautodesk-viewerautodesk-model-derivative

pass svf/pdf bytes to the viewer.start(options.document,options) command so we can load local svf/pdf derivatives


we are working on setting up a flutter app to support an offline viewer. The issue comes when passing a local url path to the options parameter as per mentioned in the svf extraction github sample.

js code in the flutter app

function initViewer(container) {
     const options = {
     env: "Local",
     document:
     "data/user/0/com.example.../...pdf",
     };
     viewer.start(
        options.document,
        options)

since a webview widget (Local http server) can't access to the mobile application documen directory (file system) we are struggling with this step. Can you provide any direction in which we can manage to pass bytes of data to the start command or somewhere to get the viewer started.

All the best Miguel G.

We were trying to tweak the pdf.js file but didn't find the line of code for reading the local path


Solution

  • With flutterinappwebview widget we can set a local path, intercept that file request and return a different bytearray data