We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am new to node.js and I want to write "rows" object to a text file. Can you help with below code.
Basically a way to iterate the rows object.
var pdf2table = require('pdf2table'); var fs = require('fs'); var logger = fs.createWriteStream('log.txt', { flags: 'a' }) fs.readFile('./test.pdf', function (err, buffer) { if (err) return console.log(err); pdf2table.parse(buffer, function (err, rows, rowsdebug) { if (err) return console.log(err); console.log(rows); logger.write(rows); }); });
The text was updated successfully, but these errors were encountered:
Something like:
var pdf2table = require('pdf2table'); var fs = require('fs'); var logger = fs.createWriteStream('log.txt', { flags: 'a' }) fs.readFile('./test.pdf', function (err, buffer) { if (err) return console.log(err); pdf2table.parse(buffer, function (err, rows, rowsdebug) { if (err) return console.log(err); console.log(rows); for (var i = 0; i < rows.length; i++) { var columns = rows[i]; var line = columns.join("\t"); logger.write(line); } }); });
Sorry, something went wrong.
No branches or pull requests
I am new to node.js and I want to write "rows" object to a text file. Can you help with below code.
Basically a way to iterate the rows object.
The text was updated successfully, but these errors were encountered: