Erster Commit

This commit is contained in:
zed
2026-03-13 09:53:40 +01:00
commit 5ebcad02ed
3945 changed files with 974582 additions and 0 deletions

29
extract-pdf.js Normal file
View File

@@ -0,0 +1,29 @@
const fs = require('fs');
const PDFParser = require("pdf2json");
function extract(fileIn, fileOut) {
return new Promise((resolve, reject) => {
const pdfParser = new PDFParser(this, 1);
pdfParser.on("pdfParser_dataError", errData => reject(errData.parserError));
pdfParser.on("pdfParser_dataReady", pdfData => {
fs.writeFileSync(fileOut, pdfParser.getRawTextContent());
console.log(`Extracted: ${fileOut}`);
resolve();
});
pdfParser.loadPDF(fileIn);
});
}
async function main() {
const args = process.argv.slice(2);
if (args.length >= 2) {
await extract(args[0], args[1]);
} else {
await extract('./docs/ZF Global DESADV 1.3.9 EN Examples.pdf', './docs/zf_examples.txt');
await extract('./docs/ZF Global DESADV 1.3.9 EN.pdf', './docs/zf_guideline.txt');
}
}
main();