How to use the pdfreader.Rule.makeItemProcessor function in pdfreader

To help you get started, we’ve selected a few pdfreader examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github adrienjoly / HsbcStatementParser / parse.js View on Github external
var PdfReader = require('pdfreader').PdfReader;
var Rule = require('pdfreader').Rule;

function displayValues(values) {
	console.log('=>', values);
}

var processItem = Rule.makeItemProcessor([
	Rule.on(/^Du ([^\s]+) au\s+(.+)/).extractRegexpValues().then(displayValues),
]);

new PdfReader().parseFileItems('20151102_RELEVE DE COMPTE_00360070251.pdf', function(err, item){
	processItem(item);
});

pdfreader

Read text and parse tables from PDF files. Supports tabular data with automatic column detection, and rule-based parsing.

MIT
Latest version published 8 days ago

Package Health Score

78 / 100
Full package analysis