@nutrient-sdk/viewer 1.9.0-nightly.20251104 → 1.9.0-nightly.20251106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -4
- package/dist/nutrient-viewer-lib/{chunk-848-4ed59312246a2b4a.js → chunk-848-beb64a662c3d7de6.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-core-worker-a09fa4d94a065bb6.js → chunk-core-worker-ae0446589300925f.js} +2 -2
- package/dist/nutrient-viewer-lib/chunk-gdpicture-a830502caf49912d.js +13 -0
- package/dist/nutrient-viewer-lib/chunk-gdpicture-worker-3803380ec39567e3.js +13 -0
- package/dist/nutrient-viewer-lib/{chunk-lazy-sha-73f6c966a13ce855.js → chunk-lazy-sha-5967b92036d4829d.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-ar-41a19c400fe5a3b4.js → chunk-locale-ar-fb2ee5126d67453b.js} +2 -2
- package/dist/nutrient-viewer-lib/{chunk-locale-cs-bf9adfb6795cb100.js → chunk-locale-cs-d0f48e97782e47fb.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-cy-64aa326914c0f531.js → chunk-locale-cy-93abaf3b574ba410.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-da-6f0efd7d95724db0.js → chunk-locale-da-636d20c32a94a46d.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-de-002594aeb0665cd4.js → chunk-locale-de-cb0054348c9a24c1.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-el-e093ae2fc72bf8cc.js → chunk-locale-el-7a692b3ee14a333c.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-en-GB-91a5daecdbf1d980.js → chunk-locale-en-GB-46f7ed2c773e2066.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-es-db3b60607deb0757.js → chunk-locale-es-eb75f04a243ac738.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-fi-cb5b04064a679b72.js → chunk-locale-fi-ff83353adb573859.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-fr-CA-f28a7860a9dc0b02.js → chunk-locale-fr-CA-c2782d57d27ea252.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-fr-827c78cf848c92d7.js → chunk-locale-fr-fbf3b71dbe4c92f4.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-he-0d95b3f8b1c90be6.js → chunk-locale-he-0e3a8dadc422511e.js} +2 -2
- package/dist/nutrient-viewer-lib/{chunk-locale-hr-b03f7025fc610492.js → chunk-locale-hr-4db7a6aab120cc9b.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-id-8a6711e472e4c78d.js → chunk-locale-id-d79328df386edb30.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-it-8cfe18a34d159283.js → chunk-locale-it-2e4d513695b8f82e.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-ja-1f065178d9c344d0.js → chunk-locale-ja-a57ba99d71b8cadd.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-ko-603b063d416f9312.js → chunk-locale-ko-00dcb471fa8d9eee.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-ms-3e84870ceeabf252.js → chunk-locale-ms-f010c014a806a33e.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-nb-NO-e210f469b60ddfbd.js → chunk-locale-nb-NO-17a29fdb79799feb.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-nl-b18bca322b2e8a19.js → chunk-locale-nl-4d28f0b6ca9b28f0.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-pl-f5440dafe6afa46b.js → chunk-locale-pl-69bd5e1bb0ce63c8.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-pt-5bb04b80f8f6e2ab.js → chunk-locale-pt-9b66ccc664f4e7a8.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-pt-PT-e97afbf44a746ae4.js → chunk-locale-pt-PT-19f1b69be8b5c859.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-ru-986b17ebc25f8281.js → chunk-locale-ru-57dd3dd81cc086d7.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-sk-53f43113fdd8169c.js → chunk-locale-sk-ea9e3ae96348d6f3.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-sl-f24484bc0c5db88a.js → chunk-locale-sl-7f1fadfb51e9c6a6.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-sv-937125db91b6aaf2.js → chunk-locale-sv-710a3aa3b7e62960.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-th-35a17ce77615263d.js → chunk-locale-th-8983853191eb6ab9.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-tr-2dd4f9715feda10b.js → chunk-locale-tr-1dab2df43186fc5e.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-uk-347cbc688bb294a5.js → chunk-locale-uk-feaa5b66d63976ff.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-zh-Hans-1ce1eca20b61062d.js → chunk-locale-zh-Hans-84716cc9f182047c.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-locale-zh-Hant-4985933b4ba1f0c3.js → chunk-locale-zh-Hant-07e25e4c35b018f6.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-offscreen-renderer-worker-66d688df8bc6085e.js → chunk-offscreen-renderer-worker-781af49639028f51.js} +2 -2
- package/dist/nutrient-viewer-lib/{chunk-server-7951ac880ab7163f.js → chunk-server-4e0d2acd1e8eae9c.js} +2 -2
- package/dist/nutrient-viewer-lib/{chunk-server-instant-e196b4c69d0703f4.js → chunk-server-instant-6b81c07150548eaf.js} +1 -1
- package/dist/nutrient-viewer-lib/{chunk-server-rest-03f727e99e800f5b.js → chunk-server-rest-0b77428d271dde3e.js} +1 -1
- package/dist/nutrient-viewer-lib/chunk-standalone-d9dd85f9c9bd4703.js +13 -0
- package/dist/nutrient-viewer-lib/{chunk-standalone-server-c38d2fe22fb21301.js → chunk-standalone-server-d1e7b0e07d9ac8b8.js} +2 -2
- package/dist/nutrient-viewer-lib/core-worker.js +2 -2
- package/dist/nutrient-viewer-lib/dark-402cc98d3d69bff8.css +1 -1
- package/dist/nutrient-viewer-lib/gdpicture-worker.js +2 -2
- package/dist/nutrient-viewer-lib/{nutrient-viewer-1.9.0-289f7eb.css → nutrient-viewer-1.9.0-e1c5b2f.css} +1 -1
- package/dist/nutrient-viewer-lib/{nutrient-viewer-10b7c6b7e7b294e5.wasm.js → nutrient-viewer-c80b83693128d5ab.wasm.js} +2 -2
- package/dist/nutrient-viewer-lib/{nutrient-viewer-bcda162dc220314f.wasm → nutrient-viewer-e3e03fdf97d7b327.wasm} +0 -0
- package/dist/nutrient-viewer-lib/offscreen-render-worker.js +1 -1
- package/dist/nutrient-viewer.js +2 -2
- package/package.json +1 -1
- package/dist/nutrient-viewer-lib/chunk-gdpicture-82715936e41c75e8.js +0 -13
- package/dist/nutrient-viewer-lib/chunk-gdpicture-worker-d2dfb0c8d115c63f.js +0 -13
- package/dist/nutrient-viewer-lib/chunk-standalone-6da9065e3555763f.js +0 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nutrient-sdk/viewer",
|
|
3
|
-
"version": "1.9.0-nightly.
|
|
3
|
+
"version": "1.9.0-nightly.20251106",
|
|
4
4
|
"description": "View and annotate PDF files in your web app. Full support for mobile and desktop. Runs in the browser using WASM.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pdf",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Nutrient Web SDK 1.9.0-289f7eb (https://www.nutrient.io/sdk/web)
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2016-2025 PSPDFKit GmbH. All rights reserved.
|
|
5
|
-
*
|
|
6
|
-
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
7
|
-
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
8
|
-
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
9
|
-
* This notice may not be removed from this file.
|
|
10
|
-
*
|
|
11
|
-
* PSPDFKit uses several open source third-party components: https://www.nutrient.io/legal/acknowledgements/web-acknowledgements/
|
|
12
|
-
*/
|
|
13
|
-
"use strict";(globalThis.webpackChunkNutrientViewer=globalThis.webpackChunkNutrientViewer||[]).push([[860],{60919:(e,t,r)=>{r.r(t),r.d(t,{Conformance:()=>o,GdPicture:()=>w,GdPictureWorker:()=>F,getBrowserSpawner:()=>S});var s=r(85409),n=r(25030);let o=function(e){return e[e.pdf_a_1a=0]="pdf_a_1a",e[e.pdf_a_1b=1]="pdf_a_1b",e[e.pdf_a_2a=2]="pdf_a_2a",e[e.pdf_a_2u=3]="pdf_a_2u",e[e.pdf_a_2b=4]="pdf_a_2b",e[e.pdf_a_3a=5]="pdf_a_3a",e[e.pdf_a_3u=6]="pdf_a_3u",e[e.pdf_a_3b=7]="pdf_a_3b",e[e.pdf_a_4=8]="pdf_a_4",e[e.pdf_a_4e=9]="pdf_a_4e",e[e.pdf_a_4f=10]="pdf_a_4f",e}({});const a="/create.pdf",i="/save.pdf",u="/create.docx",l="/save.docx",d="/templateData.json",c="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope;let f=null,p=null;function m(e){let t;(0,s.V1)(p,"GdPicture WebAssembly is not loaded.");for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];for(const e of n)t=Object.assign(n[0],e);const a=JSON.stringify({type:e,...t}),i=JSON.parse(p.CommandHandler(a));if(!i.success)throw new Error(i.errorReason+": "+i.errorMessage+"\n"+i.error);return i}class w{_mountCustomFonts(e,t){(0,s.V1)(f,"WebAssembly module not loaded."),f.FS.mkdir(t);{const r=c?f.FS.filesystems.WORKERFS:f.FS.filesystems.MEMFS;f.FS.mount(r,{blobs:e},t)}}async loadModule(e,t,r,s,o,a,i){const{Assemblies:u,Module:l}=await async function(e,t){if("string"==typeof e){const r="nutrient-viewer-lib/",s=`${r}gdpicture-aa63976b/jit`,n=`${r}gdpicture-aa63976b/aot`;let o,a;t?(o=`${e}${n}/initDotnet.js`,a=`${e}${n}`):(o=`${e}${s}/initDotnet.js`,a=`${e}${s}`);const{initDotnet:i}=await import(o);return i(a,((e,t,r,s,n)=>"blazor.boot.json"===t?fetch(r,{credentials:"same-origin"}):null))}throw new Error("GdPicture WASM loader not implemented")}(e,t);p=u.GdPictureWasm.API,f=l,m("gdpicture/setLicense",{origin:r},{licenseKey:s||"DEMO_PSPDFKIT_WEB"});const d=o?"/fonts":"";if(o&&!f.FS.analyzePath(d).exists&&(this._mountCustomFonts(o,d),m("gdpicture/setFonts",{fontPaths:[d]})),a){const e=await(0,n.sw)(a);m("gdpicture/setDynamicFontLoading",{baseUrl:a.split("/").slice(0,-1).join("/"),allowedFonts:e.availableFonts,v:1})}i&&m("gdpicture/setFontSubstitutions",{fontSubstitutions:i})}toPdf(e,t,r){f.FS.writeFile(a,new Uint8Array(e));const s={file:i,format:"pdf",conformance:t&&t in o?t:void 0,officeConversionSettings:b(r)};try{return m("gdpicture/process",{input:{file:a},output:s}),f.FS.readFile(i).buffer}finally{try{f.FS.unlink(i)}catch(e){}}}toOffice(e,t){f.FS.writeFile(a,new Uint8Array(e));const r=`/save.${t}`;try{return m("gdpicture/process",{input:{file:a},output:{file:r,format:t}}),f.FS.readFile(r).buffer}finally{try{f.FS.unlink(r)}catch(e){console.log(e.message)}}}async populateDocumentTemplate(e,t){let r;f.FS.writeFile(u,new Uint8Array(e));try{r=JSON.stringify(t,null,2)}catch(e){throw new Error("Invalid config data")}f.FS.writeFile(d,r);try{return m("gdpicture/process-office-template",{inputFile:u,modelAndConfigFile:d,outputFile:l}),f.FS.readFile(l).buffer}finally{try{f.FS.unlink(l),f.FS.unlink(d)}catch(e){console.log(e.message)}}}}const h={allMarkup:0,simpleMarkup:1,noMarkup:2,original:3},_=h.noMarkup,g={documentMarkupMode:_};function b(e){if(!e)return g;if(!e.documentMarkupMode)return{...e,documentMarkupMode:_};if(!(e.documentMarkupMode in h))throw new Error(`Invalid documentMarkupMode value: ${e.documentMarkupMode}. Allowed values are: ${Object.keys(h).join(", ")}`);return{...e,documentMarkupMode:h[e.documentMarkupMode]}}var y=r(67136);const F=class{constructor(e){let{baseUrl:t,aot:r,mainThreadOrigin:n,licenseKey:o,customFonts:a,dynamicFonts:i,fontSubstitutions:u,workerSpawner:l,wasmLoaderPath:d}=e;(0,y.A)(this,"requests",new Map),(0,y.A)(this,"nextRequestId",1),(0,y.A)(this,"handleMessage",(e=>{const t=e.data,r=this.requests.get(t.id);(0,s.V1)(r,`No request was made for id ${t.id}.`);const{resolve:n,reject:o}=r;if(this.requests.delete(t.id),t.error){const e=new s.uE(t.error);e.callArgs=t.callArgs,o(e)}else n(t.result)})),this.workerSpawner=l,this.workerSpawner.setMessageHandler(this.handleMessage),this.moduleLoadPromise=this.sendRequest("loadModule",[d?{baseUrl:t,wasmLoaderPath:d}:t,r,n,o,a,i,u])}toOffice(e,t){return this.sendRequest("toOffice",[e,t])}toPdf(e,t,r){let s;return t&&(s=t.replace("pdf","pdf_").replaceAll("-","_")),this.sendRequest("toPdf",[e,s,r])}async populateDocumentTemplate(e,t){return this.sendRequest("populateDocumentTemplate",[e,t])}destroy(){this.workerSpawner?.terminate(),this.workerSpawner=null}async sendRequest(e,t){(0,s.V1)(this.workerSpawner,"GdPictureClient has been destroyed"),this.moduleLoadPromise&&await this.moduleLoadPromise;const r=this.workerSpawner;return new Promise(((s,n)=>{const o=this.assignId(),a=[...t].filter((e=>e instanceof ArrayBuffer));r.postMessage({id:o,action:e,args:t},a),this.requests=this.requests.set(o,{resolve:s,reject:n})}))}assignId(){const e=this.nextRequestId;return this.nextRequestId=this.nextRequestId+1,e}};const S=async function(){let e;if(!(arguments.length>0&&void 0!==arguments[0])||arguments[0]){const{default:t}=await r.e(11).then(r.bind(r,37979));e=new t}else e=new Worker(new URL(r.p+r.u(374),r.b));return{setMessageHandler(t){(0,s.V1)(e,"Worker is null"),e.onmessage=t},postMessage(t,r){e?.postMessage(t,r)},terminate(){e?.terminate(),e=null}}}}}]);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Nutrient Web SDK 1.9.0-289f7eb (https://www.nutrient.io/sdk/web)
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2016-2025 PSPDFKit GmbH. All rights reserved.
|
|
5
|
-
*
|
|
6
|
-
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
7
|
-
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
8
|
-
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
9
|
-
* This notice may not be removed from this file.
|
|
10
|
-
*
|
|
11
|
-
* PSPDFKit uses several open source third-party components: https://www.nutrient.io/legal/acknowledgements/web-acknowledgements/
|
|
12
|
-
*/
|
|
13
|
-
"use strict";(globalThis.webpackChunkNutrientViewer=globalThis.webpackChunkNutrientViewer||[]).push([[11],{37979:(e,t,n)=>{n.d(t,{default:()=>a});var r=n(55512),o=n.n(r);function a(){return o()('/*!\n * Nutrient Web SDK 1.9.0-289f7eb (https://www.nutrient.io/sdk/web)\n *\n * Copyright (c) 2016-2025 PSPDFKit GmbH. All rights reserved.\n *\n * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW\n * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.\n * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.\n * This notice may not be removed from this file.\n *\n * PSPDFKit uses several open source third-party components: https://www.nutrient.io/legal/acknowledgements/web-acknowledgements/\n */(()=>{"use strict";const e=function e(t){let n;return n=t instanceof Error?t:new Error(t),Object.setPrototypeOf(n,e.prototype),n};e.prototype=Object.create(Error.prototype,{name:{value:"PSPDFKitError",enumerable:!1}});const t=e;function n(e,n){if(!e)throw new t(`Assertion failed: ${n||"Condition not met"}\\n\\nFor further assistance, please go to: https://www.nutrient.io/support/request`)}["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[contenteditable]",\'[tabindex]:not([tabindex^="-"])\'].join(",");new WeakMap;async function r(e){const n=(await async function(e){try{const n=await fetch(e).catch((n=>{throw new t(`Error fetching dynamic fonts file ${e}. ${n}`)}));if(200!==n.status)throw new t(`Error fetching dynamic fonts file ${e}. Status code: ${n.status}`);return n}catch(e){throw e}}(e)).json().catch((n=>{throw new t(`Error parsing dynamic fonts file ${e}. ${n}`)}));return n}let o=function(e){return e[e.pdf_a_1a=0]="pdf_a_1a",e[e.pdf_a_1b=1]="pdf_a_1b",e[e.pdf_a_2a=2]="pdf_a_2a",e[e.pdf_a_2u=3]="pdf_a_2u",e[e.pdf_a_2b=4]="pdf_a_2b",e[e.pdf_a_3a=5]="pdf_a_3a",e[e.pdf_a_3u=6]="pdf_a_3u",e[e.pdf_a_3b=7]="pdf_a_3b",e[e.pdf_a_4=8]="pdf_a_4",e[e.pdf_a_4e=9]="pdf_a_4e",e[e.pdf_a_4f=10]="pdf_a_4f",e}({});const a="/create.pdf",i="/save.pdf",s="/create.docx",c="/save.docx",l="/templateData.json",f="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope;let u=null,d=null;function p(e){let t;n(d,"GdPicture WebAssembly is not loaded.");for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];for(const e of o)t=Object.assign(o[0],e);const i=JSON.stringify({type:e,...t}),s=JSON.parse(d.CommandHandler(i));if(!s.success)throw new Error(s.errorReason+": "+s.errorMessage+"\\n"+s.error);return s}const m={allMarkup:0,simpleMarkup:1,noMarkup:2,original:3},_=m.noMarkup,y={documentMarkupMode:_};function b(e){if(!e)return y;if(!e.documentMarkupMode)return{...e,documentMarkupMode:_};if(!(e.documentMarkupMode in m))throw new Error(`Invalid documentMarkupMode value: ${e.documentMarkupMode}. Allowed values are: ${Object.keys(m).join(", ")}`);return{...e,documentMarkupMode:m[e.documentMarkupMode]}}const g=new class{_mountCustomFonts(e,t){n(u,"WebAssembly module not loaded."),u.FS.mkdir(t);{const n=f?u.FS.filesystems.WORKERFS:u.FS.filesystems.MEMFS;u.FS.mount(n,{blobs:e},t)}}async loadModule(e,t,n,o,a,i,s){const{Assemblies:c,Module:l}=await async function(e,t){if("string"==typeof e){const n="nutrient-viewer-lib/",r=`${n}gdpicture-aa63976b/jit`,o=`${n}gdpicture-aa63976b/aot`;let a,i;t?(a=`${e}${o}/initDotnet.js`,i=`${e}${o}`):(a=`${e}${r}/initDotnet.js`,i=`${e}${r}`);const{initDotnet:s}=await import(a);return s(i,((e,t,n,r,o)=>"blazor.boot.json"===t?fetch(n,{credentials:"same-origin"}):null))}throw new Error("GdPicture WASM loader not implemented")}(e,t);d=c.GdPictureWasm.API,u=l,p("gdpicture/setLicense",{origin:n},{licenseKey:o||"DEMO_PSPDFKIT_WEB"});const f=a?"/fonts":"";if(a&&!u.FS.analyzePath(f).exists&&(this._mountCustomFonts(a,f),p("gdpicture/setFonts",{fontPaths:[f]})),i){const e=await r(i);p("gdpicture/setDynamicFontLoading",{baseUrl:i.split("/").slice(0,-1).join("/"),allowedFonts:e.availableFonts,v:1})}s&&p("gdpicture/setFontSubstitutions",{fontSubstitutions:s})}toPdf(e,t,n){u.FS.writeFile(a,new Uint8Array(e));const r={file:i,format:"pdf",conformance:t&&t in o?t:void 0,officeConversionSettings:b(n)};try{return p("gdpicture/process",{input:{file:a},output:r}),u.FS.readFile(i).buffer}finally{try{u.FS.unlink(i)}catch(e){}}}toOffice(e,t){u.FS.writeFile(a,new Uint8Array(e));const n=`/save.${t}`;try{return p("gdpicture/process",{input:{file:a},output:{file:n,format:t}}),u.FS.readFile(n).buffer}finally{try{u.FS.unlink(n)}catch(e){console.log(e.message)}}}async populateDocumentTemplate(e,t){let n;u.FS.writeFile(s,new Uint8Array(e));try{n=JSON.stringify(t,null,2)}catch(e){throw new Error("Invalid config data")}u.FS.writeFile(l,n);try{return p("gdpicture/process-office-template",{inputFile:s,modelAndConfigFile:l,outputFile:c}),u.FS.readFile(c).buffer}finally{try{u.FS.unlink(c),u.FS.unlink(l)}catch(e){console.log(e.message)}}}},w=self;w.global=w,w.module={},w.onmessage=async e=>{let t,n,{data:r}=e;try{const e=await g[r.action](...r.args);if(t={id:r.id,result:e},Array.isArray(e)){const t=e.filter((e=>e instanceof ArrayBuffer));t.length>0&&(n=t)}e instanceof ArrayBuffer&&(n=[e])}catch(e){const o=[...r.args].filter((e=>e instanceof ArrayBuffer));o.length>0&&(n=o),t={id:r.id,error:e.message||e.toString(),callArgs:r.args}}w.postMessage(t,n)}})();',"Worker",void 0,void 0)}},55512:e=>{e.exports=function(e,t,n,r){var o=self||window;try{try{var a;try{a=new o.Blob([e])}catch(t){(a=new(o.BlobBuilder||o.WebKitBlobBuilder||o.MozBlobBuilder||o.MSBlobBuilder)).append(e),a=a.getBlob()}var i=o.URL||o.webkitURL,s=i.createObjectURL(a),u=new o[t](s,n);return i.revokeObjectURL(s),u}catch(r){return new o[t]("data:application/javascript,".concat(encodeURIComponent(e)),n)}}catch(e){if(!r)throw Error("Inline worker is not supported");return new o[t](r,n)}}}}]);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Nutrient Web SDK 1.9.0-289f7eb (https://www.nutrient.io/sdk/web)
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2016-2025 PSPDFKit GmbH. All rights reserved.
|
|
5
|
-
*
|
|
6
|
-
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
7
|
-
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
8
|
-
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
9
|
-
* This notice may not be removed from this file.
|
|
10
|
-
*
|
|
11
|
-
* PSPDFKit uses several open source third-party components: https://www.nutrient.io/legal/acknowledgements/web-acknowledgements/
|
|
12
|
-
*/
|
|
13
|
-
"use strict";(globalThis.webpackChunkNutrientViewer=globalThis.webpackChunkNutrientViewer||[]).push([[362],{63993:(e,t,s)=>{s.r(t),s.d(t,{corePool:()=>l.mG,customFontsPromiseRef:()=>_,default:()=>b,loadModule:()=>D,normalizeCoreOptions:()=>l.DO,validateStandaloneConfiguration:()=>l.mn});var a=s(49568),n=s(85409),i=s(55994),o=s(41204),r=s(85410),l=s(20873),c=s(37506),u=s(85553),d=s(89055),h=s(68322),m=s(88405),f=s(84318),p=s(33075);async function g(e,t,s,a){const n={credentials:"same-origin"};if(s&&Object.keys(s).length>0){const e=new Headers;Object.entries(s).forEach((t=>{let[s,a]=t;e.append(s,a)})),n.headers=e}const i=await fetch(e,n).finally((()=>{a?.()})),o=await i.arrayBuffer();return{isFullyAvailable:!0,fullDocument:o,contentType:i.headers?.get("Content-Type")||await(0,p.oj)(o,t)}}async function y(e,t,s,a,o){if(e instanceof ArrayBuffer)return{isFullyAvailable:!0,fullDocument:e,contentType:await(0,p.oj)(e,t)};(0,n.V1)("string"==typeof e,"Document is not a string");let r=!1;const{linearizedDocument:l,serverSupportsRangeRequests:c}=await(async()=>{if(s&&function(e){if(e.startsWith("/"))return!0;try{const t=new URL(e);return"http:"===t.protocol||"https:"===t.protocol}catch(e){return!1}}(e)){const s=await t.openLinearizedDocument(i.EA);return(0,n.V1)(s,"Linearized document is not available"),{linearizedDocument:s,serverSupportsRangeRequests:await s.initialize(e,a)}}return{linearizedDocument:null,serverSupportsRangeRequests:!1}})();try{if(!c)return r=!0,g(e,t,a,o);(0,n.V1)(l,"Linearized document is not available"),l.startDownload();if(!await l.waitUntilIsLinearizedIsKnown())return l.destroy(),r=!0,g(e,t,a,o);o?.();const s=await l.waitUntilDocumentInfoAvailable();return s?(o?.(),{isFullyAvailable:!1,documentResponse:s,contentType:"application/pdf"}):(l.destroy(),r=!0,g(e,t,a,o))}catch(s){if(l?.destroy(),r)throw s;return g(e,t,a,o)}}let w;class b extends l.Ay{constructor(e){const t=e.baseUrl||(0,r.$_)(window.document),s=e.baseCoreUrl||t,a=e.baseProcessorEngineUrl||t,i={...e,baseUrl:t,baseCoreUrl:s,baseProcessorEngineUrl:a};if("string"!=typeof i.baseUrl)throw new n.uE("`baseUrl` is mandatory and must be a valid URL, e.g. `https://example.com/`");if("string"!=typeof i.document&&!(i.document instanceof ArrayBuffer))throw new n.uE("document must be either an URL to a supported document type (PDF and images), e.g. `https://example.com/document.pdf`, or an `ArrayBuffer`");if(w&&w!==i.licenseKey)throw new n.uE("Trying to re-use instance with a different licenseKey.\nUnfortunately we only allow one licenseKey per instance.\nPlease contact support for further assistance.");if("string"==typeof i.licenseKey&&i.licenseKey.startsWith("TRIAL-"))throw new n.uE("You're using the npm key instead of the license key. This key is used to download the Nutrient Web SDK package via the node package manager.\n\nLeave out the license key to activate as a trial.");super(i),this.destroyed=!1,this.activeConfiguration=e}async load(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=.2;e.progressCallback&&e.progressCallback("loading",t),this._isPDFJavaScriptEnabled=e.isPDFJavaScriptEnabled,"string"==typeof this._state.document&&(0,p.XC)(this._state.baseUrl,this._state.document,this._state.productId);const s=await D(this.client,this._state).finally((()=>{t+=.3,e.progressCallback&&e.progressCallback("loading",t)})),i=y(this._state.document,this.corePDFDocument,this._state.allowLinearizedLoading,this._state.httpHeaders||void 0,(()=>{t+=.3,e.progressCallback&&e.progressCallback("loading",t)}));(0,n.V1)(s);const{features:r,signatureFeatureAvailability:l,capabilities:c}=s;if(this._state.productId===h.v.SharePoint&&"string"==typeof this._state.document&&Array.isArray(s.afu)){const e=new URL(this._state.document,this._state.baseUrl);if(!s.afu.some((t=>e.hostname.match(t))))throw new n.uE(`The document origin ${e.hostname} is not authorized.`)}const f=l===u.g.ELECTRONIC_SIGNATURES&&(0,d.UX)(r)&&this._state.forceLegacySignaturesFeature?u.g.LEGACY_SIGNATURES:l;this._state=this._state.set("features",(0,a.B8)(r)).set("signatureFeatureAvailability",f),w=this._state.licenseKey;const g=await i;let b=null;if(g.isFullyAvailable){let t=g.fullDocument.slice(0),s=null;if((0,p.C5)(g.contentType)||!c.includes("GdPictureWASM"))try{this.destroyed?(t=null,b=await new Promise((()=>{}))):(b=await this.client.openDocument(g.fullDocument,{password:e.password,initialPageIndex:"number"==typeof e.initialPageIndex?e.initialPageIndex:0,formsConfiguration:this._formsConfiguration}),t=null)}catch(e){"INVALID_PASSWORD"===e.message&&this._state.document instanceof ArrayBuffer?this._state=this._state.set("document",e.callArgs[0]):"IMAGE_DOCUMENTS_NOT_LICENSED"===e.message?e.message="The image documents feature is not enabled for your license key. Please contact support or sales to purchase the UI module for your product.":c.includes("GdPictureWASM")||(e.message="File not in PDF format or corrupted."),s=e}if(c.includes("GdPictureWASM")&&(s instanceof n.uE&&s.message.includes("File not in PDF format or corrupted.")||!(0,p.C5)(g.contentType))){(0,n.V1)(t);let a,i=(0,m.jU)();try{i||(i=(0,m.NY)({baseUrl:this._state.baseProcessorEngineUrl,mainThreadOrigin:this._state.appName||(0,o.D5)()||window.location.origin,licenseKey:this._state.licenseKey||void 0,customFonts:this._state.customFonts||void 0,dynamicFonts:this._state.dynamicFonts||void 0,fontSubstitutions:this._state.fontSubstitutions,processorEngine:this._state.processorEngine}),(0,m.Pm)(i)),a=await i,(0,n.V1)(a);const s=await a.toPdf(t,null,e.officeConversionSettings);b=await this.client.openDocument(s,{password:e.password,initialPageIndex:"number"==typeof e.initialPageIndex?e.initialPageIndex:0,formsConfiguration:this._formsConfiguration})}catch(e){throw"INVALID_PASSWORD"===e.message&&this._state.document instanceof ArrayBuffer&&(this._state=this._state.set("document",s.callArgs[0])),"IMAGE_DOCUMENTS_NOT_LICENSED"===e.message&&(e.message="The image documents feature is not enabled for your license key. Please contact support or sales to purchase the UI module for your product."),e}finally{t=null,a?.destroy(),(0,m.Pm)(null)}}else if(s)throw s;(0,n.V1)(b),await this.afterDocumentLoaded(b)}else b=g.documentResponse;return this._state=this._state.set("documentResponse",b),{features:this._state.features,signatureFeatureAvailability:this._state.signatureFeatureAvailability,hasPassword:!!e.password,password:e.password,allowedTileScales:"all",evaluation:s.evaluation,linearizedLoading:!g.isFullyAvailable,documentResponse:b}}destroy(){this.destroyed=!0,super.destroy()}getCustomFontsPromise(){return _}async afterDocumentLoaded(e){if(this._isPDFJavaScriptEnabled&&(this._initialChanges=await this.client.enablePDFJavaScriptSupport()),this._XFDF&&await this.client.importXFDF(this._XFDF.source,this._XFDF.keepCurrentAnnotations,this._XFDF.ignorePageRotation,this._XFDF.richTextEnabled),this._instantJSON&&this._instantJSON.pdfId&&e.ID.permanent){const t=this._instantJSON.pdfId,s=e.ID;if(t.permanent!==s.permanent)throw new n.uE("Could not instantiate from Instant JSON: Permanent PDF ID mismatch.\nPlease use the same PDF document that was used to create this Instant JSON.\nFor more information, please visit: https://www.nutrient.io/guides/web/importing-exporting/instant-json/");if(t.changing!==s.changing)throw new n.uE("Could not instantiate from Instant JSON: Changing PDF ID mismatch.\nPlease use the same revision of this PDF document that was used to create this Instant JSON.\nFor more information, please visit: https://www.nutrient.io/guides/web/importing-exporting/instant-json/")}if(this._trustedCAsCallback)try{const e=await this._trustedCAsCallback();if(!Array.isArray(e))throw new n.uE("Certificates response must be an array");if(e.some((e=>!(e instanceof ArrayBuffer)&&"string"!=typeof e)))throw new n.uE("All certificates must be passed as ArrayBuffer (DER) or string (PEM)");await this.client.loadCertificates(e.map(c.PI))}catch(e){throw new n.uE(`Could not retrieve certificates for digital signatures validation: ${e.message}.`)}}async waitUntilFullyLoaded(e){return this.corePDFDocument.linearizedDocument.waitUntilDownloaded().then((async()=>{await this.corePDFDocument.normallyOpenLinearizedDocument(this,{password:e,initialPageIndex:0,formsConfiguration:this._formsConfiguration}),await this.afterDocumentLoaded(this._state.documentResponse)}))}async getDocumentBytes(){if(this._state.document instanceof ArrayBuffer)return this._state.document;if("string"==typeof this._state.document){const e=await fetch(this._state.document);if(!e.ok)throw new n.uE(`Failed to fetch document: ${e.statusText}`);return e.arrayBuffer()}throw new n.uE("Document bytes are not available")}}const _={current:void 0};async function D(e,t){_.current=_.current||(t.customFonts?(0,f.eY)(t.customFonts):void 0);const s=(0,r.f)(t.appName);return e.loadNativeModule(t.baseCoreUrl,{mainThreadOrigin:s,disableWebAssemblyStreaming:t.disableWebAssemblyStreaming,enableAutomaticLinkExtraction:t.enableAutomaticLinkExtraction,overrideMemoryLimit:t.overrideMemoryLimit,workerSpawnerFn:()=>(0,i.pj)(t.inlineWorkers)}).then((async()=>e.load(t.baseCoreUrl,t.licenseKey,{mainThreadOrigin:s,..._.current?{customFonts:await _.current}:null,dynamicFonts:t.dynamicFonts,productId:t.productId,featureFlags:(()=>{const e=[];return t.enableCoreUnifiedComments&&e.push("UnifiedComments"),t.enableCorePreservePDFAccessibility&&e.push("PreservePDFAccessibility"),e.length>0?e:void 0})()})))}}}]);
|