@pspdfkit/nodejs
Version:
Convert documents in your Node.js apps.
13 lines • 1.07 kB
JavaScript
/*!
* PSPDFKit for Node.js 0.0.7 (https://pspdfkit.com/nodejs)
*
* Copyright (c) 2024 PSPDFKit GmbH. All rights reserved.
*
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
* This notice may not be removed from this file.
*
* PSPDFKit uses several open source third-party components: https://pspdfkit.com/acknowledgements/nodejs/
*/
import{dotnet as t}from"./dotnet.js";export async function initDotnet(e,i){if(null===e||"string"!=typeof e||0===e.trim().length)throw Error("`baseUrl` must be a string passed to `initDotnet` and be non-empty.");let{getAssemblyExports:a,getConfig:r,Module:n}=await t.withConfig({locateFile:t=>`${e}/${t}`}).withResourceLoader(i).create();globalThis.gdPicture={module:n,baseUrl:e};let o=await a(r().mainAssemblyName);return await o.GdPictureWasm.API.Initialize(),{Assemblies:o,Module:n,BaseUrl:e}}