pdfxtract 1.0.0 → 1.0.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/cli.js +2 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -6,9 +6,10 @@ import { parseArgs } from "node:util";
|
|
|
6
6
|
import { extractText, getDocumentProxy } from "unpdf";
|
|
7
7
|
|
|
8
8
|
//#region src/converter.ts
|
|
9
|
+
const VERBOSITY_ERRORS = 0;
|
|
9
10
|
async function convertPdf(pdfPath, txtPath) {
|
|
10
11
|
const buffer = await readFile(pdfPath);
|
|
11
|
-
const pdf = await getDocumentProxy(new Uint8Array(buffer));
|
|
12
|
+
const pdf = await getDocumentProxy(new Uint8Array(buffer), { verbosity: VERBOSITY_ERRORS });
|
|
12
13
|
try {
|
|
13
14
|
const { text } = await extractText(pdf, { mergePages: true });
|
|
14
15
|
await writeFile(txtPath, text, "utf-8");
|