Created
February 25, 2019 00:02
-
-
Save bryanwongbh/a8cbeba604c290401353c2789d2c9135 to your computer and use it in GitHub Desktop.
PDF Parse
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs = require('fs'); | |
var PDFParser = require("pdf2json/pdfParser"); | |
var pdfParser = new PDFParser(this,1); | |
pdfParser.on("pdfParser_dataError", errData => console.error(errData.parserError) ); | |
pdfParser.on("pdfParser_dataReady", pdfData => { | |
console.log("Raw - "); | |
console.log(pdfParser.getRawTextContent()); | |
fs.writeFile("./hello.json", JSON.stringify(pdfData)); | |
}); | |
pdfParser.loadPDF("./listed_companies_entitlements.pdf"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment