@embedpdf/engines 1.0.16 → 1.0.17
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/engine-Bcr-xNy6.cjs +2 -0
- package/dist/engine-Bcr-xNy6.cjs.map +1 -0
- package/dist/{engine-B11yoQGd.js → engine-uSZXjmb5.js} +610 -295
- package/dist/engine-uSZXjmb5.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/lib/pdfium/cache.d.ts +7 -0
- package/dist/lib/pdfium/engine.d.ts +129 -56
- package/dist/lib/pdfium/index.cjs +1 -1
- package/dist/lib/pdfium/index.js +2 -2
- package/dist/lib/pdfium/web/direct-engine.cjs +1 -1
- package/dist/lib/pdfium/web/direct-engine.js +1 -1
- package/dist/lib/pdfium/web/worker-engine.cjs +1 -1
- package/dist/lib/pdfium/web/worker-engine.js +1 -1
- package/dist/lib/webworker/engine.cjs +1 -1
- package/dist/lib/webworker/engine.cjs.map +1 -1
- package/dist/lib/webworker/engine.d.ts +42 -36
- package/dist/lib/webworker/engine.js +22 -7
- package/dist/lib/webworker/engine.js.map +1 -1
- package/dist/lib/webworker/runner.d.ts +21 -1
- package/dist/preact/index.cjs +1 -1
- package/dist/preact/index.js +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.js +1 -1
- package/dist/{runner-D9_9TvyZ.js → runner-BOJ4naYI.js} +28 -2
- package/dist/runner-BOJ4naYI.js.map +1 -0
- package/dist/runner-C64KrEhP.cjs +2 -0
- package/dist/runner-C64KrEhP.cjs.map +1 -0
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.js +1 -1
- package/package.json +3 -3
- package/dist/engine-B11yoQGd.js.map +0 -1
- package/dist/engine-v2kq6ghL.cjs +0 -2
- package/dist/engine-v2kq6ghL.cjs.map +0 -1
- package/dist/runner-D9_9TvyZ.js.map +0 -1
- package/dist/runner-Dnb6tfxR.cjs +0 -2
- package/dist/runner-Dnb6tfxR.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./engine-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./engine-Bcr-xNy6.cjs"),r=require("./runner-C64KrEhP.cjs"),t=require("./lib/webworker/engine.cjs"),n=require("@embedpdf/models");exports.BitmapFormat=e.BitmapFormat,exports.PdfiumEngine=e.PdfiumEngine,exports.PdfiumErrorCode=e.PdfiumErrorCode,exports.RenderFlag=e.RenderFlag,exports.browserImageDataToBlobConverter=e.browserImageDataToBlobConverter,exports.readArrayBuffer=e.readArrayBuffer,exports.readString=e.readString,exports.EngineRunner=r.EngineRunner,exports.PdfiumEngineRunner=r.PdfiumEngineRunner,exports.WebWorkerEngine=t.WebWorkerEngine,exports.WorkerTask=t.WorkerTask,exports.createMockPdfDocument=function(e){const r=[];for(let t=0;t<10;t++)r.push({index:t,size:{width:100,height:200}});return{id:"id",pageCount:10,pages:r,...e}},exports.createMockPdfEngine=function(e){return{openDocumentUrl:jest.fn(((e,r)=>n.PdfTaskHelper.create())),openDocumentFromBuffer:jest.fn(((e,r)=>n.PdfTaskHelper.create())),openDocumentFromLoader:jest.fn(((e,r)=>n.PdfTaskHelper.create())),getMetadata:()=>n.PdfTaskHelper.resolve({title:"title",author:"author",subject:"subject",keywords:"keywords",producer:"producer",creator:"creator",creationDate:"creationDate",modificationDate:"modificationDate"}),getDocPermissions:e=>n.PdfTaskHelper.resolve(4294967295),getDocUserPermissions:e=>n.PdfTaskHelper.resolve(4294967295),getSignatures:e=>n.PdfTaskHelper.resolve([]),getBookmarks:e=>{const r=[];return r.push({title:"Page 1",target:{type:"destination",destination:{pageIndex:1,zoom:{mode:n.PdfZoomMode.FitPage},view:[]}}},{title:"Page 2",target:{type:"destination",destination:{pageIndex:2,zoom:{mode:n.PdfZoomMode.FitPage},view:[]}},children:[{title:"Page 3",target:{type:"destination",destination:{pageIndex:3,zoom:{mode:n.PdfZoomMode.FitPage},view:[]}}}]}),n.PdfTaskHelper.resolve({bookmarks:r})},renderPage:jest.fn(((e,r,t,o,a,s)=>{const i=o%2==0?r.size:n.swap(r.size),d=Math.ceil(i.width*t)*Math.ceil(i.height*t),f=new Uint8ClampedArray(4*d),l=r.index%255;for(let n=0;n<d;n++){for(let e=0;e<3;e++){f[4*n+e]=l}f[4*n+3]=255}const p=f.buffer,c=p instanceof ArrayBuffer?p:new Uint8Array(f).buffer,g=new Blob([c],{type:"application/octet-stream"});return n.PdfTaskHelper.resolve(g)})),renderPageRect:jest.fn(((e,r,t,o,a,s,i)=>{const d=o%2==0?r.size:n.swap(r.size),f=Math.ceil(d.width*t)*Math.ceil(d.height*t),l=new Uint8ClampedArray(4*f),p=r.index%255;for(let n=0;n<f;n++){for(let e=0;e<3;e++){l[4*n+e]=p}l[4*n+3]=255}const c=l.buffer,g=c instanceof ArrayBuffer?c:new Uint8Array(l).buffer,u=new Blob([g],{type:"application/octet-stream"});return n.PdfTaskHelper.resolve(u)})),renderThumbnail:jest.fn(((e,r)=>{const t=r.size.width/4*(r.size.height/4),o=new Uint8ClampedArray(4*t),a=r.index%255;for(let n=0;n<t;n++){for(let e=0;e<3;e++){o[4*n+e]=a}o[4*n+3]=255}const s=o.buffer,i=s instanceof ArrayBuffer?s:new Uint8Array(o).buffer,d=new Blob([i],{type:"image/png"});return n.PdfTaskHelper.resolve(d)})),renderAnnotation:jest.fn(((e,r,t,o,a,s,i,d)=>n.PdfTaskHelper.resolve(new Blob([],{type:"image/png"})))),getAllAnnotations:jest.fn((e=>n.PdfTaskHelper.resolve({}))),getPageAnnotations:jest.fn(((e,r)=>{const t={pageIndex:r.index,id:r.index+1,type:n.PdfAnnotationSubtype.LINK,target:{type:"action",action:{type:n.PdfActionType.URI,uri:"https://localhost"}},text:"localhost",rect:{origin:{x:0,y:0},size:{width:100,height:100}}},o=[];return o.push(t),n.PdfTaskHelper.resolve(o)})),createPageAnnotation:jest.fn((()=>n.PdfTaskHelper.resolve(1))),updatePageAnnotation:jest.fn((()=>n.PdfTaskHelper.resolve(!0))),removePageAnnotation:jest.fn((()=>n.PdfTaskHelper.resolve(!0))),getPageTextRects:jest.fn(((e,r,t,o)=>n.PdfTaskHelper.resolve([{content:"pdf text",font:{family:"sans-serif",size:12},rect:{origin:{x:0,y:0},size:{width:100,height:100}}}]))),closeDocument:e=>n.PdfTaskHelper.resolve(!0),saveAsCopy:e=>n.PdfTaskHelper.resolve(new ArrayBuffer(0)),flattenPage:(e,r,t)=>n.PdfTaskHelper.resolve(n.PdfPageFlattenResult.Success),extractPages:(e,r)=>n.PdfTaskHelper.resolve(new ArrayBuffer(0)),extractText:(e,r)=>n.PdfTaskHelper.resolve(""),getTextSlices:(e,r)=>n.PdfTaskHelper.resolve([]),getPageGlyphs:(e,r)=>n.PdfTaskHelper.resolve([]),getPageGeometry:(e,r)=>n.PdfTaskHelper.resolve({runs:[]}),merge:e=>n.PdfTaskHelper.resolve({id:"id",content:new ArrayBuffer(0)}),mergePages:e=>n.PdfTaskHelper.resolve({id:"id",content:new ArrayBuffer(0)}),searchAllPages:(e,r,t)=>{const o={pageIndex:0,charIndex:0,charCount:r.length,rects:[{origin:{x:0,y:0},size:{width:50,height:20}}],context:{before:"",match:"",after:"",truncatedLeft:!1,truncatedRight:!1}};return n.PdfTaskHelper.resolve({results:[o],total:1})},getAttachments:e=>n.PdfTaskHelper.resolve([]),readAttachmentContent:(e,r)=>n.PdfTaskHelper.resolve(new ArrayBuffer(0)),setFormFieldValue:(e,r,t,o)=>n.PdfTaskHelper.resolve(!0),...e}},exports.createMockPdfFile=function(e){return{id:"id",content:new ArrayBuffer(0)}};
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B, a, P, R, b, c, r } from "./engine-
|
|
2
|
-
import { E, P as P2 } from "./runner-
|
|
1
|
+
import { B, a, P, R, b, c, r } from "./engine-uSZXjmb5.js";
|
|
2
|
+
import { E, P as P2 } from "./runner-BOJ4naYI.js";
|
|
3
3
|
import { WebWorkerEngine, WorkerTask } from "./lib/webworker/engine.js";
|
|
4
4
|
import { PdfTaskHelper, PdfActionType, PdfAnnotationSubtype, swap, PdfPageFlattenResult, PdfZoomMode } from "@embedpdf/models";
|
|
5
5
|
function createMockPdfEngine(partialEngine) {
|
|
@@ -17,6 +17,8 @@ export declare class DocumentContext {
|
|
|
17
17
|
constructor(filePtr: number, docPtr: number, pdfium: WrappedPdfiumModule);
|
|
18
18
|
/** Main accessor for pages */
|
|
19
19
|
acquirePage(pageIdx: number): PageContext;
|
|
20
|
+
/** Scoped accessor for one-off / bulk operations */
|
|
21
|
+
borrowPage<T>(pageIdx: number, fn: (ctx: PageContext) => T): T;
|
|
20
22
|
/** Tear down all pages + this document */
|
|
21
23
|
dispose(): void;
|
|
22
24
|
}
|
|
@@ -26,6 +28,11 @@ export declare class PageCache {
|
|
|
26
28
|
private readonly cache;
|
|
27
29
|
constructor(pdf: WrappedPdfiumModule, docPtr: number);
|
|
28
30
|
acquire(pageIdx: number): PageContext;
|
|
31
|
+
/** Helper: run a function “scoped” to a page.
|
|
32
|
+
* – if the page was already cached → .release() (keeps TTL logic)
|
|
33
|
+
* – if the page was loaded just now → .disposeImmediate() (free right away)
|
|
34
|
+
*/
|
|
35
|
+
borrowPage<T>(pageIdx: number, fn: (ctx: PageContext) => T): T;
|
|
29
36
|
forceReleaseAll(): void;
|
|
30
37
|
}
|
|
31
38
|
export declare class PageContext {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PdfAnnotationObject, PdfTextRectObject, PdfWidgetAnnoObject, Logger, SearchTarget, MatchFlag, PdfBookmarkObject, PdfDocumentObject, PdfEngine, PdfPageObject, Rotation, Rect, PdfAttachmentObject, PdfSignatureObject, PdfRenderOptions,
|
|
1
|
+
import { PdfAnnotationObject, PdfTextRectObject, PdfWidgetAnnoObject, Logger, SearchTarget, MatchFlag, PdfBookmarkObject, PdfDocumentObject, PdfEngine, PdfPageObject, Rotation, Rect, PdfAttachmentObject, PdfSignatureObject, PdfRenderOptions, Position, PdfStampAnnoObject, PdfCircleAnnoObject, PdfSquareAnnoObject, PdfSquigglyAnnoObject, PdfStrikeOutAnnoObject, PdfUnderlineAnnoObject, PdfFile, AppearanceMode, PdfHighlightAnnoObject, FormFieldValue, PdfPageFlattenFlag, PdfPageFlattenResult, PdfTask, PdfFileLoader, SearchAllPagesResult, PdfUrlOptions, PdfFileUrl, Task, PdfErrorReason, PdfGlyphObject, PdfPageGeometry, PdfImage, ImageConversionTypes, PageTextSlice, AnnotationCreateContext, PdfPageSearchProgress } from '@embedpdf/models';
|
|
2
2
|
import { WrappedPdfiumModule } from '@embedpdf/pdfium';
|
|
3
3
|
/**
|
|
4
4
|
* Format of bitmap
|
|
@@ -85,19 +85,19 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
85
85
|
*
|
|
86
86
|
* @public
|
|
87
87
|
*/
|
|
88
|
-
initialize(): Task<boolean, PdfErrorReason>;
|
|
88
|
+
initialize(): Task<boolean, PdfErrorReason, unknown>;
|
|
89
89
|
/**
|
|
90
90
|
* {@inheritDoc @embedpdf/models!PdfEngine.destroy}
|
|
91
91
|
*
|
|
92
92
|
* @public
|
|
93
93
|
*/
|
|
94
|
-
destroy(): Task<boolean, PdfErrorReason>;
|
|
94
|
+
destroy(): Task<boolean, PdfErrorReason, unknown>;
|
|
95
95
|
/**
|
|
96
96
|
* {@inheritDoc @embedpdf/models!PdfEngine.openDocumentUrl}
|
|
97
97
|
*
|
|
98
98
|
* @public
|
|
99
99
|
*/
|
|
100
|
-
openDocumentUrl(file: PdfFileUrl, options?: PdfUrlOptions): Task<PdfDocumentObject, PdfErrorReason>;
|
|
100
|
+
openDocumentUrl(file: PdfFileUrl, options?: PdfUrlOptions): Task<PdfDocumentObject, PdfErrorReason, unknown>;
|
|
101
101
|
/**
|
|
102
102
|
* Check if the server supports range requests:
|
|
103
103
|
* Sends a HEAD request and sees if 'Accept-Ranges: bytes'.
|
|
@@ -129,19 +129,19 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
129
129
|
*
|
|
130
130
|
* @public
|
|
131
131
|
*/
|
|
132
|
-
openDocumentFromBuffer(file: PdfFile, password?: string): Task<PdfDocumentObject, PdfErrorReason>;
|
|
132
|
+
openDocumentFromBuffer(file: PdfFile, password?: string): Task<PdfDocumentObject, PdfErrorReason, unknown>;
|
|
133
133
|
/**
|
|
134
134
|
* {@inheritDoc @embedpdf/models!PdfEngine.openDocumentFromLoader}
|
|
135
135
|
*
|
|
136
136
|
* @public
|
|
137
137
|
*/
|
|
138
|
-
openDocumentFromLoader(fileLoader: PdfFileLoader, password?: string): Task<PdfDocumentObject, PdfErrorReason>;
|
|
138
|
+
openDocumentFromLoader(fileLoader: PdfFileLoader, password?: string): Task<PdfDocumentObject, PdfErrorReason, unknown>;
|
|
139
139
|
/**
|
|
140
140
|
* {@inheritDoc @embedpdf/models!PdfEngine.getMetadata}
|
|
141
141
|
*
|
|
142
142
|
* @public
|
|
143
143
|
*/
|
|
144
|
-
getMetadata(doc: PdfDocumentObject): Task<any, PdfErrorReason> | Task<{
|
|
144
|
+
getMetadata(doc: PdfDocumentObject): Task<any, PdfErrorReason, unknown> | Task<{
|
|
145
145
|
title: string;
|
|
146
146
|
author: string;
|
|
147
147
|
subject: string;
|
|
@@ -150,33 +150,33 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
150
150
|
creator: string;
|
|
151
151
|
creationDate: string;
|
|
152
152
|
modificationDate: string;
|
|
153
|
-
}, PdfErrorReason>;
|
|
153
|
+
}, PdfErrorReason, unknown>;
|
|
154
154
|
/**
|
|
155
155
|
* {@inheritDoc @embedpdf/models!PdfEngine.getDocPermissions}
|
|
156
156
|
*
|
|
157
157
|
* @public
|
|
158
158
|
*/
|
|
159
|
-
getDocPermissions(doc: PdfDocumentObject): Task<any, PdfErrorReason> | Task<number, PdfErrorReason>;
|
|
159
|
+
getDocPermissions(doc: PdfDocumentObject): Task<any, PdfErrorReason, unknown> | Task<number, PdfErrorReason, unknown>;
|
|
160
160
|
/**
|
|
161
161
|
* {@inheritDoc @embedpdf/models!PdfEngine.getDocUserPermissions}
|
|
162
162
|
*
|
|
163
163
|
* @public
|
|
164
164
|
*/
|
|
165
|
-
getDocUserPermissions(doc: PdfDocumentObject): Task<any, PdfErrorReason> | Task<number, PdfErrorReason>;
|
|
165
|
+
getDocUserPermissions(doc: PdfDocumentObject): Task<any, PdfErrorReason, unknown> | Task<number, PdfErrorReason, unknown>;
|
|
166
166
|
/**
|
|
167
167
|
* {@inheritDoc @embedpdf/models!PdfEngine.getSignatures}
|
|
168
168
|
*
|
|
169
169
|
* @public
|
|
170
170
|
*/
|
|
171
|
-
getSignatures(doc: PdfDocumentObject): Task<any, PdfErrorReason> | Task<PdfSignatureObject[], PdfErrorReason>;
|
|
171
|
+
getSignatures(doc: PdfDocumentObject): Task<any, PdfErrorReason, unknown> | Task<PdfSignatureObject[], PdfErrorReason, unknown>;
|
|
172
172
|
/**
|
|
173
173
|
* {@inheritDoc @embedpdf/models!PdfEngine.getBookmarks}
|
|
174
174
|
*
|
|
175
175
|
* @public
|
|
176
176
|
*/
|
|
177
|
-
getBookmarks(doc: PdfDocumentObject): Task<any, PdfErrorReason> | Task<{
|
|
177
|
+
getBookmarks(doc: PdfDocumentObject): Task<any, PdfErrorReason, unknown> | Task<{
|
|
178
178
|
bookmarks: PdfBookmarkObject[];
|
|
179
|
-
}, PdfErrorReason>;
|
|
179
|
+
}, PdfErrorReason, unknown>;
|
|
180
180
|
/**
|
|
181
181
|
* {@inheritDoc @embedpdf/models!PdfEngine.renderPage}
|
|
182
182
|
*
|
|
@@ -194,14 +194,18 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
194
194
|
*
|
|
195
195
|
* @public
|
|
196
196
|
*/
|
|
197
|
-
getAllAnnotations(doc: PdfDocumentObject):
|
|
197
|
+
getAllAnnotations(doc: PdfDocumentObject): PdfTask<Record<number, PdfAnnotationObject[]>, // final result
|
|
198
|
+
{
|
|
199
|
+
page: number;
|
|
200
|
+
annotations: PdfAnnotationObject[];
|
|
201
|
+
}>;
|
|
198
202
|
private readAllAnnotations;
|
|
199
203
|
/**
|
|
200
204
|
* {@inheritDoc @embedpdf/models!PdfEngine.getPageAnnotations}
|
|
201
205
|
*
|
|
202
206
|
* @public
|
|
203
207
|
*/
|
|
204
|
-
getPageAnnotations(doc: PdfDocumentObject, page: PdfPageObject): Task<any, PdfErrorReason> | Task<PdfAnnotationObject[], PdfErrorReason>;
|
|
208
|
+
getPageAnnotations(doc: PdfDocumentObject, page: PdfPageObject): Task<any, PdfErrorReason, unknown> | Task<PdfAnnotationObject[], PdfErrorReason, unknown>;
|
|
205
209
|
/**
|
|
206
210
|
* {@inheritDoc @embedpdf/models!PdfEngine.createPageAnnotation}
|
|
207
211
|
*
|
|
@@ -223,13 +227,13 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
223
227
|
*
|
|
224
228
|
* @public
|
|
225
229
|
*/
|
|
226
|
-
removePageAnnotation(doc: PdfDocumentObject, page: PdfPageObject, annotation: PdfAnnotationObject): Task<boolean, PdfErrorReason> | Task<any, PdfErrorReason>;
|
|
230
|
+
removePageAnnotation(doc: PdfDocumentObject, page: PdfPageObject, annotation: PdfAnnotationObject): Task<boolean, PdfErrorReason, unknown> | Task<any, PdfErrorReason, unknown>;
|
|
227
231
|
/**
|
|
228
232
|
* {@inheritDoc @embedpdf/models!PdfEngine.getPageTextRects}
|
|
229
233
|
*
|
|
230
234
|
* @public
|
|
231
235
|
*/
|
|
232
|
-
getPageTextRects(doc: PdfDocumentObject, page: PdfPageObject, scaleFactor: number, rotation: Rotation): Task<any, PdfErrorReason> | Task<PdfTextRectObject[], PdfErrorReason>;
|
|
236
|
+
getPageTextRects(doc: PdfDocumentObject, page: PdfPageObject, scaleFactor: number, rotation: Rotation): Task<any, PdfErrorReason, unknown> | Task<PdfTextRectObject[], PdfErrorReason, unknown>;
|
|
233
237
|
/**
|
|
234
238
|
* {@inheritDoc @embedpdf/models!PdfEngine.renderThumbnail}
|
|
235
239
|
*
|
|
@@ -241,19 +245,19 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
241
245
|
*
|
|
242
246
|
* @public
|
|
243
247
|
*/
|
|
244
|
-
getAttachments(doc: PdfDocumentObject): Task<any, PdfErrorReason> | Task<PdfAttachmentObject[], PdfErrorReason>;
|
|
248
|
+
getAttachments(doc: PdfDocumentObject): Task<any, PdfErrorReason, unknown> | Task<PdfAttachmentObject[], PdfErrorReason, unknown>;
|
|
245
249
|
/**
|
|
246
250
|
* {@inheritDoc @embedpdf/models!PdfEngine.readAttachmentContent}
|
|
247
251
|
*
|
|
248
252
|
* @public
|
|
249
253
|
*/
|
|
250
|
-
readAttachmentContent(doc: PdfDocumentObject, attachment: PdfAttachmentObject): Task<any, PdfErrorReason> | Task<ArrayBuffer, PdfErrorReason>;
|
|
254
|
+
readAttachmentContent(doc: PdfDocumentObject, attachment: PdfAttachmentObject): Task<any, PdfErrorReason, unknown> | Task<ArrayBuffer, PdfErrorReason, unknown>;
|
|
251
255
|
/**
|
|
252
256
|
* {@inheritDoc @embedpdf/models!PdfEngine.setFormFieldValue}
|
|
253
257
|
*
|
|
254
258
|
* @public
|
|
255
259
|
*/
|
|
256
|
-
setFormFieldValue(doc: PdfDocumentObject, page: PdfPageObject, annotation: PdfWidgetAnnoObject, value: FormFieldValue): Task<boolean, PdfErrorReason> | Task<any, PdfErrorReason>;
|
|
260
|
+
setFormFieldValue(doc: PdfDocumentObject, page: PdfPageObject, annotation: PdfWidgetAnnoObject, value: FormFieldValue): Task<boolean, PdfErrorReason, unknown> | Task<any, PdfErrorReason, unknown>;
|
|
257
261
|
/**
|
|
258
262
|
* {@inheritDoc @embedpdf/models!PdfEngine.flattenPage}
|
|
259
263
|
*
|
|
@@ -265,13 +269,13 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
265
269
|
*
|
|
266
270
|
* @public
|
|
267
271
|
*/
|
|
268
|
-
extractPages(doc: PdfDocumentObject, pageIndexes: number[]): Task<any, PdfErrorReason> | Task<ArrayBuffer, PdfErrorReason>;
|
|
272
|
+
extractPages(doc: PdfDocumentObject, pageIndexes: number[]): Task<any, PdfErrorReason, unknown> | Task<ArrayBuffer, PdfErrorReason, unknown>;
|
|
269
273
|
/**
|
|
270
274
|
* {@inheritDoc @embedpdf/models!PdfEngine.extractText}
|
|
271
275
|
*
|
|
272
276
|
* @public
|
|
273
277
|
*/
|
|
274
|
-
extractText(doc: PdfDocumentObject, pageIndexes: number[]): Task<any, PdfErrorReason> | Task<string, PdfErrorReason>;
|
|
278
|
+
extractText(doc: PdfDocumentObject, pageIndexes: number[]): Task<any, PdfErrorReason, unknown> | Task<string, PdfErrorReason, unknown>;
|
|
275
279
|
/**
|
|
276
280
|
* {@inheritDoc @embedpdf/models!PdfEngine.getTextSlices}
|
|
277
281
|
*
|
|
@@ -283,7 +287,7 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
283
287
|
*
|
|
284
288
|
* @public
|
|
285
289
|
*/
|
|
286
|
-
merge(files: PdfFile[]): Task<any, PdfErrorReason> | Task<PdfFile, PdfErrorReason>;
|
|
290
|
+
merge(files: PdfFile[]): Task<any, PdfErrorReason, unknown> | Task<PdfFile, PdfErrorReason, unknown>;
|
|
287
291
|
/**
|
|
288
292
|
* Merges specific pages from multiple PDF documents in a custom order
|
|
289
293
|
*
|
|
@@ -294,19 +298,19 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
294
298
|
mergePages(mergeConfigs: Array<{
|
|
295
299
|
docId: string;
|
|
296
300
|
pageIndices: number[];
|
|
297
|
-
}>): Task<any, PdfErrorReason> | Task<PdfFile, PdfErrorReason>;
|
|
301
|
+
}>): Task<any, PdfErrorReason, unknown> | Task<PdfFile, PdfErrorReason, unknown>;
|
|
298
302
|
/**
|
|
299
303
|
* {@inheritDoc @embedpdf/models!PdfEngine.saveAsCopy}
|
|
300
304
|
*
|
|
301
305
|
* @public
|
|
302
306
|
*/
|
|
303
|
-
saveAsCopy(doc: PdfDocumentObject): Task<any, PdfErrorReason> | Task<ArrayBuffer, PdfErrorReason>;
|
|
307
|
+
saveAsCopy(doc: PdfDocumentObject): Task<any, PdfErrorReason, unknown> | Task<ArrayBuffer, PdfErrorReason, unknown>;
|
|
304
308
|
/**
|
|
305
309
|
* {@inheritDoc @embedpdf/models!PdfEngine.closeDocument}
|
|
306
310
|
*
|
|
307
311
|
* @public
|
|
308
312
|
*/
|
|
309
|
-
closeDocument(doc: PdfDocumentObject): Task<boolean, PdfErrorReason> | Task<any, PdfErrorReason>;
|
|
313
|
+
closeDocument(doc: PdfDocumentObject): Task<boolean, PdfErrorReason, unknown> | Task<any, PdfErrorReason, unknown>;
|
|
310
314
|
/**
|
|
311
315
|
* Memory allocation
|
|
312
316
|
* @param size - size of memory space
|
|
@@ -322,7 +326,28 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
322
326
|
* @public
|
|
323
327
|
*/
|
|
324
328
|
free(ptr: number): void;
|
|
325
|
-
|
|
329
|
+
/**
|
|
330
|
+
* Add text content to annotation
|
|
331
|
+
* @param page - page info
|
|
332
|
+
* @param pagePtr - pointer to page object
|
|
333
|
+
* @param annotationPtr - pointer to text annotation
|
|
334
|
+
* @param annotation - text annotation
|
|
335
|
+
* @returns whether text content is added to annotation
|
|
336
|
+
*
|
|
337
|
+
* @private
|
|
338
|
+
*/
|
|
339
|
+
private addTextContent;
|
|
340
|
+
/**
|
|
341
|
+
* Add free text content to annotation
|
|
342
|
+
* @param page - page info
|
|
343
|
+
* @param pagePtr - pointer to page object
|
|
344
|
+
* @param annotationPtr - pointer to free text annotation
|
|
345
|
+
* @param annotation - free text annotation
|
|
346
|
+
* @returns whether free text content is added to annotation
|
|
347
|
+
*
|
|
348
|
+
* @private
|
|
349
|
+
*/
|
|
350
|
+
private addFreeTextContent;
|
|
326
351
|
/**
|
|
327
352
|
* Set the rect of specified annotation
|
|
328
353
|
* @param page - page info that the annotation is belonged to
|
|
@@ -333,7 +358,7 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
333
358
|
*
|
|
334
359
|
* @private
|
|
335
360
|
*/
|
|
336
|
-
addInkStroke
|
|
361
|
+
private addInkStroke;
|
|
337
362
|
/**
|
|
338
363
|
* Add line content to annotation
|
|
339
364
|
* @param page - page info
|
|
@@ -504,6 +529,7 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
504
529
|
* @private
|
|
505
530
|
*/
|
|
506
531
|
private readPageAnnotations;
|
|
532
|
+
private readPageAnnotationsRaw;
|
|
507
533
|
/**
|
|
508
534
|
* Read pdf annotation from pdf document
|
|
509
535
|
* @param page - pdf page infor
|
|
@@ -640,6 +666,21 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
640
666
|
*/
|
|
641
667
|
private getBorderStyle;
|
|
642
668
|
private setBorderStyle;
|
|
669
|
+
/**
|
|
670
|
+
* Get the icon of the annotation
|
|
671
|
+
*
|
|
672
|
+
* @param annotationPtr - pointer to an `FPDF_ANNOTATION`
|
|
673
|
+
* @returns `PdfAnnotationIcon`
|
|
674
|
+
*/
|
|
675
|
+
private getAnnotationIcon;
|
|
676
|
+
/**
|
|
677
|
+
* Set the icon of the annotation
|
|
678
|
+
*
|
|
679
|
+
* @param annotationPtr - pointer to an `FPDF_ANNOTATION`
|
|
680
|
+
* @param icon - `PdfAnnotationIcon`
|
|
681
|
+
* @returns `true` on success
|
|
682
|
+
*/
|
|
683
|
+
private setAnnotationIcon;
|
|
643
684
|
/**
|
|
644
685
|
* Border-effect (“cloudy”) helper
|
|
645
686
|
*
|
|
@@ -663,6 +704,23 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
663
704
|
* • the four floats are 0 when `ok` is false
|
|
664
705
|
*/
|
|
665
706
|
private getRectangleDifferences;
|
|
707
|
+
/**
|
|
708
|
+
* Get the date of the annotation
|
|
709
|
+
*
|
|
710
|
+
* @param annotationPtr - pointer to an `FPDF_ANNOTATION`
|
|
711
|
+
* @param key - 'M' for modified date, 'CreationDate' for creation date
|
|
712
|
+
* @returns `Date` or `undefined` when PDFium can't read the date
|
|
713
|
+
*/
|
|
714
|
+
private getAnnotationDate;
|
|
715
|
+
/**
|
|
716
|
+
* Set the date of the annotation
|
|
717
|
+
*
|
|
718
|
+
* @param annotationPtr - pointer to an `FPDF_ANNOTATION`
|
|
719
|
+
* @param key - 'M' for modified date, 'CreationDate' for creation date
|
|
720
|
+
* @param date - `Date` to set
|
|
721
|
+
* @returns `true` on success
|
|
722
|
+
*/
|
|
723
|
+
private setAnnotationDate;
|
|
666
724
|
/**
|
|
667
725
|
* Dash-pattern helper ( /BS → /D array, dashed borders only )
|
|
668
726
|
*
|
|
@@ -767,7 +825,6 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
767
825
|
/**
|
|
768
826
|
* Read pdf text annotation
|
|
769
827
|
* @param page - pdf page infor
|
|
770
|
-
* @param pagePtr - pointer to pdf page object
|
|
771
828
|
* @param annotationPtr - pointer to pdf annotation
|
|
772
829
|
* @param index - index of annotation in the pdf page
|
|
773
830
|
* @returns pdf text annotation
|
|
@@ -778,7 +835,6 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
778
835
|
/**
|
|
779
836
|
* Read pdf freetext annotation
|
|
780
837
|
* @param page - pdf page infor
|
|
781
|
-
* @param pagePtr - pointer to pdf page object
|
|
782
838
|
* @param annotationPtr - pointer to pdf annotation
|
|
783
839
|
* @param index - index of annotation in the pdf page
|
|
784
840
|
* @returns pdf freetext annotation
|
|
@@ -790,8 +846,6 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
790
846
|
* Read pdf link annotation from pdf document
|
|
791
847
|
* @param page - pdf page infor
|
|
792
848
|
* @param docPtr - pointer to pdf document object
|
|
793
|
-
* @param pagePtr - pointer to pdf page object
|
|
794
|
-
* @param textPagePtr - pointer to pdf text page object
|
|
795
849
|
* @param annotationPtr - pointer to pdf annotation
|
|
796
850
|
* @param index - index of annotation in the pdf page
|
|
797
851
|
* @returns pdf link annotation
|
|
@@ -802,7 +856,6 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
802
856
|
/**
|
|
803
857
|
* Read pdf widget annotation
|
|
804
858
|
* @param page - pdf page infor
|
|
805
|
-
* @param pagePtr - pointer to pdf page object
|
|
806
859
|
* @param annotationPtr - pointer to pdf annotation
|
|
807
860
|
* @param formHandle - form handle
|
|
808
861
|
* @param index - index of annotation in the pdf page
|
|
@@ -814,7 +867,6 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
814
867
|
/**
|
|
815
868
|
* Read pdf file attachment annotation
|
|
816
869
|
* @param page - pdf page infor
|
|
817
|
-
* @param pagePtr - pointer to pdf page object
|
|
818
870
|
* @param annotationPtr - pointer to pdf annotation
|
|
819
871
|
* @param index - index of annotation in the pdf page
|
|
820
872
|
* @returns pdf file attachment annotation
|
|
@@ -825,7 +877,6 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
825
877
|
/**
|
|
826
878
|
* Read pdf ink annotation
|
|
827
879
|
* @param page - pdf page infor
|
|
828
|
-
* @param pagePtr - pointer to pdf page object
|
|
829
880
|
* @param annotationPtr - pointer to pdf annotation
|
|
830
881
|
* @param index - index of annotation in the pdf page
|
|
831
882
|
* @returns pdf ink annotation
|
|
@@ -836,7 +887,6 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
836
887
|
/**
|
|
837
888
|
* Read pdf polygon annotation
|
|
838
889
|
* @param page - pdf page infor
|
|
839
|
-
* @param pagePtr - pointer to pdf page object
|
|
840
890
|
* @param annotationPtr - pointer to pdf annotation
|
|
841
891
|
* @param index - index of annotation in the pdf page
|
|
842
892
|
* @returns pdf polygon annotation
|
|
@@ -847,7 +897,6 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
847
897
|
/**
|
|
848
898
|
* Read pdf polyline annotation
|
|
849
899
|
* @param page - pdf page infor
|
|
850
|
-
* @param pagePtr - pointer to pdf page object
|
|
851
900
|
* @param annotationPtr - pointer to pdf annotation
|
|
852
901
|
* @param index - index of annotation in the pdf page
|
|
853
902
|
* @returns pdf polyline annotation
|
|
@@ -858,7 +907,6 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
858
907
|
/**
|
|
859
908
|
* Read pdf line annotation
|
|
860
909
|
* @param page - pdf page infor
|
|
861
|
-
* @param pagePtr - pointer to pdf page object
|
|
862
910
|
* @param annotationPtr - pointer to pdf annotation
|
|
863
911
|
* @param index - index of annotation in the pdf page
|
|
864
912
|
* @returns pdf line annotation
|
|
@@ -869,7 +917,6 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
869
917
|
/**
|
|
870
918
|
* Read pdf highlight annotation
|
|
871
919
|
* @param page - pdf page infor
|
|
872
|
-
* @param pagePtr - pointer to pdf page object
|
|
873
920
|
* @param annotationPtr - pointer to pdf annotation
|
|
874
921
|
* @param index - index of annotation in the pdf page
|
|
875
922
|
* @returns pdf highlight annotation
|
|
@@ -880,7 +927,6 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
880
927
|
/**
|
|
881
928
|
* Read pdf underline annotation
|
|
882
929
|
* @param page - pdf page infor
|
|
883
|
-
* @param pagePtr - pointer to pdf page object
|
|
884
930
|
* @param annotationPtr - pointer to pdf annotation
|
|
885
931
|
* @param index - index of annotation in the pdf page
|
|
886
932
|
* @returns pdf underline annotation
|
|
@@ -891,7 +937,6 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
891
937
|
/**
|
|
892
938
|
* Read strikeout annotation
|
|
893
939
|
* @param page - pdf page infor
|
|
894
|
-
* @param pagePtr - pointer to pdf page object
|
|
895
940
|
* @param annotationPtr - pointer to pdf annotation
|
|
896
941
|
* @param index - index of annotation in the pdf page
|
|
897
942
|
* @returns pdf strikeout annotation
|
|
@@ -902,7 +947,6 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
902
947
|
/**
|
|
903
948
|
* Read pdf squiggly annotation
|
|
904
949
|
* @param page - pdf page infor
|
|
905
|
-
* @param pagePtr - pointer to pdf page object
|
|
906
950
|
* @param annotationPtr - pointer to pdf annotation
|
|
907
951
|
* @param index - index of annotation in the pdf page
|
|
908
952
|
* @returns pdf squiggly annotation
|
|
@@ -913,7 +957,6 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
913
957
|
/**
|
|
914
958
|
* Read pdf caret annotation
|
|
915
959
|
* @param page - pdf page infor
|
|
916
|
-
* @param pagePtr - pointer to pdf page object
|
|
917
960
|
* @param annotationPtr - pointer to pdf annotation
|
|
918
961
|
* @param index - index of annotation in the pdf page
|
|
919
962
|
* @returns pdf caret annotation
|
|
@@ -923,9 +966,7 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
923
966
|
private readPdfCaretAnno;
|
|
924
967
|
/**
|
|
925
968
|
* Read pdf stamp annotation
|
|
926
|
-
* @param docPtr - pointer to pdf document object
|
|
927
969
|
* @param page - pdf page infor
|
|
928
|
-
* @param pagePtr - pointer to pdf page object
|
|
929
970
|
* @param annotationPtr - pointer to pdf annotation
|
|
930
971
|
* @param index - index of annotation in the pdf page
|
|
931
972
|
* @returns pdf stamp annotation
|
|
@@ -1013,7 +1054,6 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
1013
1054
|
/**
|
|
1014
1055
|
* Read circle annotation
|
|
1015
1056
|
* @param page - pdf page infor
|
|
1016
|
-
* @param pagePtr - pointer to pdf page object
|
|
1017
1057
|
* @param annotationPtr - pointer to pdf annotation
|
|
1018
1058
|
* @param index - index of annotation in the pdf page
|
|
1019
1059
|
* @returns pdf circle annotation
|
|
@@ -1024,7 +1064,6 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
1024
1064
|
/**
|
|
1025
1065
|
* Read square annotation
|
|
1026
1066
|
* @param page - pdf page infor
|
|
1027
|
-
* @param pagePtr - pointer to pdf page object
|
|
1028
1067
|
* @param annotationPtr - pointer to pdf annotation
|
|
1029
1068
|
* @param index - index of annotation in the pdf page
|
|
1030
1069
|
* @returns pdf square annotation
|
|
@@ -1035,7 +1074,6 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
1035
1074
|
/**
|
|
1036
1075
|
* Read basic info of unsupported pdf annotation
|
|
1037
1076
|
* @param page - pdf page infor
|
|
1038
|
-
* @param pagePtr - pointer to pdf page object
|
|
1039
1077
|
* @param type - type of annotation
|
|
1040
1078
|
* @param annotationPtr - pointer to pdf annotation
|
|
1041
1079
|
* @param index - index of annotation in the pdf page
|
|
@@ -1054,6 +1092,14 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
1054
1092
|
* @private
|
|
1055
1093
|
*/
|
|
1056
1094
|
private getInReplyToId;
|
|
1095
|
+
/**
|
|
1096
|
+
* Set the in reply to id of the annotation
|
|
1097
|
+
*
|
|
1098
|
+
* @param annotationPtr - pointer to an `FPDF_ANNOTATION`
|
|
1099
|
+
* @param id - the id of the parent annotation
|
|
1100
|
+
* @returns `true` on success
|
|
1101
|
+
*/
|
|
1102
|
+
private setInReplyToId;
|
|
1057
1103
|
/**
|
|
1058
1104
|
* Fetch a string value (`/T`, `/M`, `/State`, …) from an annotation.
|
|
1059
1105
|
*
|
|
@@ -1062,6 +1108,19 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
1062
1108
|
* @private
|
|
1063
1109
|
*/
|
|
1064
1110
|
private getAnnotString;
|
|
1111
|
+
/**
|
|
1112
|
+
* Get custom data of the annotation
|
|
1113
|
+
* @param annotationPtr - pointer to pdf annotation
|
|
1114
|
+
* @returns custom data of the annotation
|
|
1115
|
+
*
|
|
1116
|
+
* @private
|
|
1117
|
+
*/
|
|
1118
|
+
private getAnnotCustom;
|
|
1119
|
+
/**
|
|
1120
|
+
* Sets custom data for an annotation by safely stringifying and storing JSON
|
|
1121
|
+
* @private
|
|
1122
|
+
*/
|
|
1123
|
+
private setAnnotCustom;
|
|
1065
1124
|
/**
|
|
1066
1125
|
* Fetches the /IT (Intent) name from an annotation as a UTF-8 JS string.
|
|
1067
1126
|
*
|
|
@@ -1087,6 +1146,24 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
1087
1146
|
* `undefined` when the annotation has no rich content.
|
|
1088
1147
|
*/
|
|
1089
1148
|
private getAnnotRichContent;
|
|
1149
|
+
/**
|
|
1150
|
+
* Get annotation by name
|
|
1151
|
+
* @param pagePtr - pointer to pdf page object
|
|
1152
|
+
* @param name - name of annotation
|
|
1153
|
+
* @returns pointer to pdf annotation
|
|
1154
|
+
*
|
|
1155
|
+
* @private
|
|
1156
|
+
*/
|
|
1157
|
+
private getAnnotationByName;
|
|
1158
|
+
/**
|
|
1159
|
+
* Remove annotation by name
|
|
1160
|
+
* @param pagePtr - pointer to pdf page object
|
|
1161
|
+
* @param name - name of annotation
|
|
1162
|
+
* @returns true on success
|
|
1163
|
+
*
|
|
1164
|
+
* @private
|
|
1165
|
+
*/
|
|
1166
|
+
private removeAnnotationByName;
|
|
1090
1167
|
/**
|
|
1091
1168
|
* Set a string value (`/T`, `/M`, `/State`, …) to an annotation.
|
|
1092
1169
|
*
|
|
@@ -1098,7 +1175,6 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
1098
1175
|
/**
|
|
1099
1176
|
* Read vertices of pdf annotation
|
|
1100
1177
|
* @param page - pdf page infor
|
|
1101
|
-
* @param pagePtr - pointer to pdf page object
|
|
1102
1178
|
* @param annotationPtr - pointer to pdf annotation
|
|
1103
1179
|
* @returns vertices of pdf annotation
|
|
1104
1180
|
*
|
|
@@ -1270,17 +1346,14 @@ export declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
|
|
|
1270
1346
|
*/
|
|
1271
1347
|
private getHighlightRects;
|
|
1272
1348
|
/**
|
|
1273
|
-
*
|
|
1274
|
-
* Returns all search results throughout the entire document
|
|
1349
|
+
* {@inheritDoc @embedpdf/models!PdfEngine.searchAllPages}
|
|
1275
1350
|
*
|
|
1276
|
-
*
|
|
1277
|
-
*
|
|
1278
|
-
* @param flags - Match flags for search
|
|
1279
|
-
* @returns Promise of all search results in the document
|
|
1351
|
+
* Runs inside the worker.
|
|
1352
|
+
* Emits per-page progress: { page, results }
|
|
1280
1353
|
*
|
|
1281
1354
|
* @public
|
|
1282
1355
|
*/
|
|
1283
|
-
searchAllPages(doc: PdfDocumentObject, keyword: string, flags?: MatchFlag[]):
|
|
1356
|
+
searchAllPages(doc: PdfDocumentObject, keyword: string, flags?: MatchFlag[]): PdfTask<SearchAllPagesResult, PdfPageSearchProgress>;
|
|
1284
1357
|
/**
|
|
1285
1358
|
* Extract word-aligned context for a search hit.
|
|
1286
1359
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../engine-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../engine-Bcr-xNy6.cjs"),e=require("../../runner-C64KrEhP.cjs");exports.BitmapFormat=r.BitmapFormat,exports.PdfiumEngine=r.PdfiumEngine,exports.PdfiumErrorCode=r.PdfiumErrorCode,exports.RenderFlag=r.RenderFlag,exports.browserImageDataToBlobConverter=r.browserImageDataToBlobConverter,exports.readArrayBuffer=r.readArrayBuffer,exports.readString=r.readString,exports.PdfiumEngineRunner=e.PdfiumEngineRunner;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/lib/pdfium/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B, a, P, R, b, c, r } from "../../engine-
|
|
2
|
-
import { P as P2 } from "../../runner-
|
|
1
|
+
import { B, a, P, R, b, c, r } from "../../engine-uSZXjmb5.js";
|
|
2
|
+
import { P as P2 } from "../../runner-BOJ4naYI.js";
|
|
3
3
|
export {
|
|
4
4
|
B as BitmapFormat,
|
|
5
5
|
a as PdfiumEngine,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/pdfium"),i=require("../../../engine-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/pdfium"),i=require("../../../engine-Bcr-xNy6.cjs");exports.createPdfiumEngine=async function(t,n){const r=await fetch(t),a=await r.arrayBuffer(),u=await e.init({wasmBinary:a});return new i.PdfiumEngine(u,n)};
|
|
2
2
|
//# sourceMappingURL=direct-engine.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { init } from "@embedpdf/pdfium";
|
|
2
|
-
import { a as PdfiumEngine } from "../../../engine-
|
|
2
|
+
import { a as PdfiumEngine } from "../../../engine-uSZXjmb5.js";
|
|
3
3
|
async function createPdfiumEngine(wasmUrl, logger) {
|
|
4
4
|
const response = await fetch(wasmUrl);
|
|
5
5
|
const wasmBinary = await response.arrayBuffer();
|