Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. var ngCompile = require('ng-node-compile');
  2. var ngEnvironment = new ngCompile();
  3. var templateHTML = getTemplateById(id);
  4.  
  5. templateHTML = ngEnvironment.$compile(templateHTML)(datas);
  6.  
  7. var phantomHTML2PDF = require('phantom-html-to-pdf')(options);
  8. phantomHTML2PDF(convertOptions, function (error, pdf) {
  9. if(error) console.log(error);
  10. // Here you have 'pdf.stream.path' which is your tmp PDF file
  11. callback(pdf);
  12. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement