Open simowaer opened 1 week ago
broken.pdf
Input:
import fs from "fs"; import PDFParser from "pdf2json"; const pdfParser = new PDFParser(); pdfParser.on("pdfParser_dataError", (errData) => console.error(errData.parserError) ); pdfParser.on("pdfParser_dataReady", (pdfData) => { fs.writeFile( "./broken.json", JSON.stringify(pdfData), (data) => console.log(data) ); }); pdfParser.loadPDF("./broken.pdf", 10);
Output:
Info: about to load PDF file ./broken.pdf Info: Load OK: ./broken.pdf Warning: Setting up fake worker. Info: PDF loaded. pagesCount = 1 Info: start to parse page:1 Info: Skipped: tiny fill: 0 x 0
broken.pdf
Input:
Output: