title: Create PDF copy of doc App script
body: <p>I am attempting to create a PDF based on the entries in a spreadsheet with the basic flow of the following.</p>
  
  <ol>
  <li>Fill in spreadsheet</li>
  <li>Fire off the submit from a menu button (pop up for asking for Job Number)</li>
  <li>Templated Doc gets a copy made and cell contents appended to a table in the copy doc.</li>
  <li>Copy doc gets saved as a PDF in a specific folder.</li>
  <li>copy of doc gets deleted.</li>
  </ol>
  
  <p>I am just trying to get the process of getting the PDF created in the specified folder. It was working prior to my creating a copy of the Doc and just using the template so I am not sure why it will not work now. Any input would be appreciated as well as any info on how to append the cell data from the sheet into the copy of the doc. Newby to be sure so any help would be appreciated. Code attached</p>
  
  <pre><code>function createDoc () {
  
      var job = Browser.inputBox('Enter Job Number', 'Job Number',       Browser.Buttons.OK);
      var dtStr = Utilities.formatDate(new Date(), "GMT", "MMddyy")
      // create temp file before edited with spreadsheet data
      var tmpName = "tmpname"
      var folder = DriveApp.getFolderById('1C_k3MvoT33WhSXVNMmFQNFhqaW8')
      var tmpl = DriveApp.getFileById('225xZAECq0rkdJnsr4k9VjL91B7vgJh8Y- t9YrsbCEgc').makeCopy(tmpName).getID();
      // get document and make PDF in folder  
      var doc = DriveApp.getFileByID(tmpl).getAs("application/pdf");
      var pdf = doc.setName(job +"-"+dtStr+".pdf");
  
      folder.createFile(pdf)    
  }
  </code></pre>