UNPKG

@nutrient-sdk/viewer

Version:

View and annotate PDF files in your web app. Full support for mobile and desktop. Runs in the browser using WASM.

1 lines 736 B
import{dotnet}from"./dotnet.js";export async function initDotnet(t,e=void 0){if(null===t||"string"!=typeof t||0===t.trim().length)throw Error("`baseUrl` must be a string passed to `initDotnet` and be non-empty.");const{getAssemblyExports:i,getConfig:r,Module:n}=await dotnet.withConfig({locateFile:e=>`${t}/${e}`}).withRuntimeOptions(["--jiterpreter-minimum-trace-hit-count=2000","--jiterpreter-wasm-bytes-limit=16777216","--jiterpreter-minimum-trace-value=10","--jiterpreter-jit-call-hit-count=500","--jiterpreter-interp-entry-hit-count=500"]).withResourceLoader(e).create();globalThis.gdPicture={module:n,baseUrl:t};const o=await i(r().mainAssemblyName);return await o.GdPictureWasm.API.Initialize(),{Assemblies:o,Module:n,BaseUrl:t}}