Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var pdfutils = require('./index').pdfutils;
- // pdfutils is a factory which starts a background thread
- // this thread is terminated in the destructor of the C++ class connected to doc
- // This frees the doc-class
- pdfutils("test.pdf", function(err, doc) {
- console.dir(doc);
- });
- // This doesn't, which prevents node from exiting
- // because doc isn't deconstructed and therefore
- // the background thread stays running.
- pdfutils("test.pdf", function(err, doc) {
- setTimeout(function() {
- console.dir(doc);
- }, 1000);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement