Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 4th, 2013  |  syntax: None  |  size: 0.37 KB  |  views: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. var txt = msgs[i].getBody();
  2.       /* We need two blob conversions - one from text to HTML and the other from HTML to PDF */
  3.       var blob = Utilities.newBlob(txt, 'text/html',"Test PDF");
  4.       Logger.log(txt);
  5.       var tempDoc = DocsList.createFile(blob);
  6.       var pdf = tempDoc.getAs('application/pdf');
  7.       pdf.setName('Email As PDF');
  8.       DocsList.createFile(pdf);
clone this paste RAW Paste Data