title: Google Apps Script how to create pdf file from base64 encoded data
body: <p>Hi I have a web service that returns base64 encoded pdf data which I need to save as pdf in a google drive folder.
  Apreciate a short demo to how to proceed especially for converting the base64 encoded pdf data to pdf file.</p>
  
  <pre><code>    function myFunction() {
    var folder = DriveApp.getFolderById("0B9EI2E_9Cj9rT1JmVk5ESnhVbjA");
    var contents = DriveApp.getFileById("18cmOQXdAaW1lmYLvDhpi4BrYFI5LWMh2");
  
  
  
     var Body = contents.getAs('text/plain');
     var bytes = Utilities.base64Decode(Body, Utilities.Charset.UTF_8);
  
  
  
     folder.createFile(bytes);
  
  
   Logger.log(folder);
  }
  </code></pre>