Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Result returns undefined + missing instructions #1

Open
aziznatour opened this issue Jun 6, 2018 · 1 comment
Open

Result returns undefined + missing instructions #1

aziznatour opened this issue Jun 6, 2018 · 1 comment

Comments

@aziznatour
Copy link

Hello,

There does not seem to be any instructions on how to use this beyond installation only.
I have the tried the following:

Code

const pathToPdf = __dirname + "/pdf/file.pdf";
const PdfOcr = require('pdf-ocr');

const opts = {
   scanFirstPageOnly: true
};

PdfOcr(pathToPdf, opts, (res, err) => {
   console.log(res);
   console.log(err);
});

Console

undefined
undefined

am I missing something?
Thanks

@zombiestruck
Copy link

zombiestruck commented Sep 30, 2020

I know it's been a long while with no response, but for those who may still be wondering:

const opts = {
	scanFirstPageOnly: true
};
const pdf = PdfOcr('./name.pdf', opts, ()=>console.log("Starting…"))
pdf.on('complete', data => console.log(data))
pdf.on('error', error => console.log(error))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants