How to use pdfreader - 6 common examples

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 oxygenhq / oxygen / lib / assertion.js View on Github external
if(inludes){
                selectNext = true;
            }
        });
}


if(srcFilePath){
    srcFilePath = oxutil.resolvePath(srcFilePath, process.cwd());
    
    // console.log('srcFilePath', srcFilePath);

    if(srcFilePath){

        new pdfreader.PdfReader().parseFileItems(srcFilePath, function(
            err,
            item
        ) {
            if(err){
                console.log('err', err);
            }

            if (item && item.page) {
                // end of file, or page
                printRows();

                var result = findedValue === expectValue;
              

                if(item && item.page){
                    console.log('---');
github oxygenhq / oxygen / ox_modules / module-pdf.js View on Github external
return new Promise(function(resolve, reject) {
        if(!path || !text){
            reject(`Bad params, path and text required, now path: ${path}, text: ${text}`);
        }
    
        const srcFilePath = path;
        const searchStr = text.replace(/\s/g, '');

        if(srcFilePath){
            new pdfreader.PdfReader().parseFileItems(srcFilePath, function(
                err,
                item
            ) {
    
                if(err){
                    let errorMessage = 'unexpected PdfReader error';
                    if(err.data && err.data.message){
                        errorMessage = err.data.message;
                    }
                    throw new OxError(errHelper.errorCode.ASSERT_ERROR, errorMessage );
                }
    
                if (item && item.page) {
                    // end of file, or page
                    let result = checkRows(searchStr, rows);
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);
});
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);
});
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);
});
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