diff --git a/lib/document.coffee b/lib/document.coffee index 6b97659..6137e54 100644 --- a/lib/document.coffee +++ b/lib/document.coffee @@ -98,11 +98,11 @@ class PDFDocument @generateXRef out @generateTrailer out - ret = '' + ret = [] for k in out - ret += k + '\n' + ret.push(k + '\n') - fn ret + fn new Buffer(ret.join(''),'binary') finalize: (fn) -> # convert strings in the info dictionary to literals @@ -168,4 +168,4 @@ class PDFDocument toString: -> "[object PDFDocument]" -module.exports = PDFDocument \ No newline at end of file +module.exports = PDFDocument