writefilesync pdf code example
Example: fs.writeFileSync in pdfDocument
var base64 = require('base64-stream');
var base64stream = pdfDoc.pipe(base64.encode());
pdfDoc.end();
var tempFileBase64 = ''
base64stream.on('data',function(buffer){
var part = buffer.toString();
tempFileBase64 += part;
console.log('process data ' + part);
});
base64streamEvaluations.on('end',function(){
console.log('final output ' + tempFileBase64);
});