-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor buffer-processing logic into its own method
so you don't have to write a temp file if you've got the PDF in memory
- Loading branch information
Showing
3 changed files
with
95 additions
and
71 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
var fs = require('fs'); | ||
var assert = require('assert'); | ||
var PDFExtract = require('../lib').PDFExtract; | ||
var pdfExtract = new PDFExtract(); | ||
var buffer = fs.readFileSync('./example.pdf'); | ||
pdfExtract.extractBuffer(buffer, {}, function(err, data) { | ||
if (err) { | ||
return console.log(err); | ||
} | ||
var expected = require('./example-output.json'); | ||
assert.deepEqual(data.meta, expected.meta); | ||
assert.deepEqual(data.pages, expected.pages); | ||
}); |
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
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