unpdf 0.4.0 → 0.4.1
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.node.cjs +2 -2
- package/dist/index.node.d.cts +2 -2
- package/dist/index.node.d.mts +2 -2
- package/dist/index.node.d.ts +2 -2
- package/dist/index.node.mjs +3 -3
- package/dist/index.web.cjs +2 -2
- package/dist/index.web.d.cts +2 -2
- package/dist/index.web.d.mts +2 -2
- package/dist/index.web.d.ts +2 -2
- package/dist/index.web.mjs +3 -3
- package/dist/index.worker.cjs +1 -1
- package/dist/index.worker.d.cts +2 -2
- package/dist/index.worker.d.mts +2 -2
- package/dist/index.worker.d.ts +2 -2
- package/dist/index.worker.mjs +1 -1
- package/dist/shared/{unpdf.e26c195e.mjs → unpdf.0f3aa1eb.mjs} +1 -1
- package/dist/shared/{unpdf.85e02bd7.cjs → unpdf.54007d6f.cjs} +2 -1
- package/dist/shared/{unpdf.6c71f5a9.mjs → unpdf.5b4a24ed.mjs} +2 -1
- package/dist/shared/{unpdf.bfd8aae1.d.ts → unpdf.72be7352.d.cts} +1 -1
- package/dist/shared/{unpdf.bfd8aae1.d.cts → unpdf.72be7352.d.mts} +1 -1
- package/dist/shared/{unpdf.bfd8aae1.d.mts → unpdf.72be7352.d.ts} +1 -1
- package/dist/shared/{unpdf.d39bdc45.cjs → unpdf.ff73f2a9.cjs} +1 -1
- package/package.json +4 -1
package/dist/index.node.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const image = require('./shared/unpdf.
|
|
4
|
-
const utils = require('./shared/unpdf.
|
|
3
|
+
const image = require('./shared/unpdf.ff73f2a9.cjs');
|
|
4
|
+
const utils = require('./shared/unpdf.54007d6f.cjs');
|
|
5
5
|
|
|
6
6
|
const decodePDFText = async (...args) => {
|
|
7
7
|
await utils.resolvePDFJSImports();
|
package/dist/index.node.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as decodePDFText$1, g as getImagesFromPage$1 } from './shared/unpdf.
|
|
2
|
-
export { a as defineUnPDFConfig } from './shared/unpdf.
|
|
1
|
+
import { d as decodePDFText$1, g as getImagesFromPage$1 } from './shared/unpdf.72be7352.cjs';
|
|
2
|
+
export { a as defineUnPDFConfig } from './shared/unpdf.72be7352.cjs';
|
|
3
3
|
import 'pdfjs-dist';
|
|
4
4
|
|
|
5
5
|
declare const decodePDFText: typeof decodePDFText$1;
|
package/dist/index.node.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as decodePDFText$1, g as getImagesFromPage$1 } from './shared/unpdf.
|
|
2
|
-
export { a as defineUnPDFConfig } from './shared/unpdf.
|
|
1
|
+
import { d as decodePDFText$1, g as getImagesFromPage$1 } from './shared/unpdf.72be7352.mjs';
|
|
2
|
+
export { a as defineUnPDFConfig } from './shared/unpdf.72be7352.mjs';
|
|
3
3
|
import 'pdfjs-dist';
|
|
4
4
|
|
|
5
5
|
declare const decodePDFText: typeof decodePDFText$1;
|
package/dist/index.node.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as decodePDFText$1, g as getImagesFromPage$1 } from './shared/unpdf.
|
|
2
|
-
export { a as defineUnPDFConfig } from './shared/unpdf.
|
|
1
|
+
import { d as decodePDFText$1, g as getImagesFromPage$1 } from './shared/unpdf.72be7352.js';
|
|
2
|
+
export { a as defineUnPDFConfig } from './shared/unpdf.72be7352.js';
|
|
3
3
|
import 'pdfjs-dist';
|
|
4
4
|
|
|
5
5
|
declare const decodePDFText: typeof decodePDFText$1;
|
package/dist/index.node.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as decodePDFText$1, g as getImagesFromPage$1 } from './shared/unpdf.
|
|
2
|
-
import { r as resolvePDFJSImports } from './shared/unpdf.
|
|
3
|
-
export { d as defineUnPDFConfig } from './shared/unpdf.
|
|
1
|
+
import { d as decodePDFText$1, g as getImagesFromPage$1 } from './shared/unpdf.0f3aa1eb.mjs';
|
|
2
|
+
import { r as resolvePDFJSImports } from './shared/unpdf.5b4a24ed.mjs';
|
|
3
|
+
export { d as defineUnPDFConfig } from './shared/unpdf.5b4a24ed.mjs';
|
|
4
4
|
|
|
5
5
|
const decodePDFText = async (...args) => {
|
|
6
6
|
await resolvePDFJSImports();
|
package/dist/index.web.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const image = require('./shared/unpdf.
|
|
4
|
-
const utils = require('./shared/unpdf.
|
|
3
|
+
const image = require('./shared/unpdf.ff73f2a9.cjs');
|
|
4
|
+
const utils = require('./shared/unpdf.54007d6f.cjs');
|
|
5
5
|
|
|
6
6
|
const decodePDFText = async (...args) => {
|
|
7
7
|
await utils.resolvePDFJSImports();
|
package/dist/index.web.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as decodePDFText$1, g as getImagesFromPage$1 } from './shared/unpdf.
|
|
2
|
-
export { a as defineUnPDFConfig } from './shared/unpdf.
|
|
1
|
+
import { d as decodePDFText$1, g as getImagesFromPage$1 } from './shared/unpdf.72be7352.cjs';
|
|
2
|
+
export { a as defineUnPDFConfig } from './shared/unpdf.72be7352.cjs';
|
|
3
3
|
import 'pdfjs-dist';
|
|
4
4
|
|
|
5
5
|
declare const decodePDFText: typeof decodePDFText$1;
|
package/dist/index.web.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as decodePDFText$1, g as getImagesFromPage$1 } from './shared/unpdf.
|
|
2
|
-
export { a as defineUnPDFConfig } from './shared/unpdf.
|
|
1
|
+
import { d as decodePDFText$1, g as getImagesFromPage$1 } from './shared/unpdf.72be7352.mjs';
|
|
2
|
+
export { a as defineUnPDFConfig } from './shared/unpdf.72be7352.mjs';
|
|
3
3
|
import 'pdfjs-dist';
|
|
4
4
|
|
|
5
5
|
declare const decodePDFText: typeof decodePDFText$1;
|
package/dist/index.web.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as decodePDFText$1, g as getImagesFromPage$1 } from './shared/unpdf.
|
|
2
|
-
export { a as defineUnPDFConfig } from './shared/unpdf.
|
|
1
|
+
import { d as decodePDFText$1, g as getImagesFromPage$1 } from './shared/unpdf.72be7352.js';
|
|
2
|
+
export { a as defineUnPDFConfig } from './shared/unpdf.72be7352.js';
|
|
3
3
|
import 'pdfjs-dist';
|
|
4
4
|
|
|
5
5
|
declare const decodePDFText: typeof decodePDFText$1;
|
package/dist/index.web.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as decodePDFText$1, g as getImagesFromPage$1 } from './shared/unpdf.
|
|
2
|
-
import { r as resolvePDFJSImports } from './shared/unpdf.
|
|
3
|
-
export { d as defineUnPDFConfig } from './shared/unpdf.
|
|
1
|
+
import { d as decodePDFText$1, g as getImagesFromPage$1 } from './shared/unpdf.0f3aa1eb.mjs';
|
|
2
|
+
import { r as resolvePDFJSImports } from './shared/unpdf.5b4a24ed.mjs';
|
|
3
|
+
export { d as defineUnPDFConfig } from './shared/unpdf.5b4a24ed.mjs';
|
|
4
4
|
|
|
5
5
|
const decodePDFText = async (...args) => {
|
|
6
6
|
await resolvePDFJSImports();
|
package/dist/index.worker.cjs
CHANGED
package/dist/index.worker.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as decodePDFText$1, g as getImagesFromPage$1 } from './shared/unpdf.
|
|
2
|
-
export { a as defineUnPDFConfig } from './shared/unpdf.
|
|
1
|
+
import { d as decodePDFText$1, g as getImagesFromPage$1 } from './shared/unpdf.72be7352.cjs';
|
|
2
|
+
export { a as defineUnPDFConfig } from './shared/unpdf.72be7352.cjs';
|
|
3
3
|
import 'pdfjs-dist';
|
|
4
4
|
|
|
5
5
|
declare const decodePDFText: typeof decodePDFText$1;
|
package/dist/index.worker.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as decodePDFText$1, g as getImagesFromPage$1 } from './shared/unpdf.
|
|
2
|
-
export { a as defineUnPDFConfig } from './shared/unpdf.
|
|
1
|
+
import { d as decodePDFText$1, g as getImagesFromPage$1 } from './shared/unpdf.72be7352.mjs';
|
|
2
|
+
export { a as defineUnPDFConfig } from './shared/unpdf.72be7352.mjs';
|
|
3
3
|
import 'pdfjs-dist';
|
|
4
4
|
|
|
5
5
|
declare const decodePDFText: typeof decodePDFText$1;
|
package/dist/index.worker.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as decodePDFText$1, g as getImagesFromPage$1 } from './shared/unpdf.
|
|
2
|
-
export { a as defineUnPDFConfig } from './shared/unpdf.
|
|
1
|
+
import { d as decodePDFText$1, g as getImagesFromPage$1 } from './shared/unpdf.72be7352.js';
|
|
2
|
+
export { a as defineUnPDFConfig } from './shared/unpdf.72be7352.js';
|
|
3
3
|
import 'pdfjs-dist';
|
|
4
4
|
|
|
5
5
|
declare const decodePDFText: typeof decodePDFText$1;
|
package/dist/index.worker.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getDocumentProxy, a as getResolvedPDFJS } from './unpdf.
|
|
1
|
+
import { g as getDocumentProxy, a as getResolvedPDFJS } from './unpdf.5b4a24ed.mjs';
|
|
2
2
|
|
|
3
3
|
async function decodePDFText(data, { mergePages = false } = {}) {
|
|
4
4
|
const pdf = await getDocumentProxy(data);
|
|
@@ -14,7 +14,8 @@ async function getDocumentProxy(data) {
|
|
|
14
14
|
async function defineUnPDFConfig({ pdfjs }) {
|
|
15
15
|
if (pdfjs) {
|
|
16
16
|
try {
|
|
17
|
-
|
|
17
|
+
const { default: mod } = await pdfjs();
|
|
18
|
+
resolvedModule = mod;
|
|
18
19
|
} catch (error) {
|
|
19
20
|
throw new Error("Resolving the PDF.js module failed. Please check your configuration.");
|
|
20
21
|
}
|
|
@@ -12,7 +12,8 @@ async function getDocumentProxy(data) {
|
|
|
12
12
|
async function defineUnPDFConfig({ pdfjs }) {
|
|
13
13
|
if (pdfjs) {
|
|
14
14
|
try {
|
|
15
|
-
|
|
15
|
+
const { default: mod } = await pdfjs();
|
|
16
|
+
resolvedModule = mod;
|
|
16
17
|
} catch (error) {
|
|
17
18
|
throw new Error("Resolving the PDF.js module failed. Please check your configuration.");
|
|
18
19
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unpdf",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.1",
|
|
5
5
|
"packageManager": "pnpm@8.6.12",
|
|
6
6
|
"description": "Utilities to work with PDFs, like extracting text",
|
|
7
7
|
"author": "Johann Schopplich <pkg@johannschopplich.com>",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"lint": "eslint .",
|
|
54
54
|
"lint:fix": "eslint . --fix",
|
|
55
55
|
"release": "bumpp --commit --push --tag",
|
|
56
|
+
"test": "tsx test/index.ts",
|
|
56
57
|
"test:types": "tsc --noEmit"
|
|
57
58
|
},
|
|
58
59
|
"peerDependencies": {
|
|
@@ -60,9 +61,11 @@
|
|
|
60
61
|
},
|
|
61
62
|
"devDependencies": {
|
|
62
63
|
"@antfu/eslint-config": "^0.40.2",
|
|
64
|
+
"@types/node": "^20.4.10",
|
|
63
65
|
"bumpp": "^9.1.1",
|
|
64
66
|
"eslint": "^8.47.0",
|
|
65
67
|
"pdfjs-dist": "^3.9.179",
|
|
68
|
+
"tsx": "^3.12.7",
|
|
66
69
|
"typescript": "^5.1.6",
|
|
67
70
|
"unbuild": "^2.0.0-rc.0"
|
|
68
71
|
}
|