Skip to content

Commit

Permalink
Merge pull request #46 from diffusi-on/to-buffer-fix
Browse files Browse the repository at this point in the history
PDF toBuffer fix
  • Loading branch information
rimiti authored May 27, 2020
2 parents c1e03ba + 1031433 commit 0403c11
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/classes/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,10 +507,10 @@ export default class Generator extends Common {
* @private
*/
_toBufferFromPDF(content) {
return content.toBuffer((err, buffer) => {
if (err) throw new Error(err);
return buffer;
});
return new Promise((resolve, reject) => content.toBuffer((err, buffer) => {
if (err) return reject(err);
return resolve(buffer);
}));
}

/**
Expand Down

0 comments on commit 0403c11

Please sign in to comment.