title: Export Individual Sheet to PDF
body: <p>EDIT: I FIXED MY ISSUE
  It turns out it was pulling the function from another .gs file I had as a backup, that I never commented out. Its always the simple things.</p>
  <p>I had a Script that I modified and worked well found <a href="https://stackoverflow.com/questions/64489841/export-specific-sheet-to-pdf">here</a> but it didn't have any functionality to hide gridlines.</p>
  <p>I spent a few hours searching and found this which works really well, but it exports the entire document and not just the individual sheet I need. What do I need to do to get it to export just the first sheet?</p>
  <pre><code>//global
          var SS = SpreadsheetApp.getActiveSpreadsheet();
          var Invoice_Sheet = SS.getSheetByName(&quot;Private Invoice&quot;);
  
  function generatePdf() {
    // Get folder containing spreadsheet, for later export
    var parents = DriveApp.getFileById(SS.getId()).getParents();
    if (parents.hasNext()) {
      var folder = parents.next();
    }
    else {
      folder = DriveApp.getRootFolder();
    }
  
    //additional parameters for exporting the sheet as a pdf
    var url_ext = 'export?exportFormat=pdf&amp;format=pdf'   //export as pdf
        // following parameters are optional...
        + '&amp;size=A4'      // paper size
        + '&amp;portrait=true'    // orientation, false for landscape
        + '&amp;fitw=true'        // fit to width, false for actual size
        + '&amp;sheetnames=false&amp;printtitle=false&amp;pagenumbers=false'  //hide optional headers and footers
        + '&amp;gridlines=false'  // hide gridlines
        + '&amp;fzr=false'       // do not repeat row headers (frozen rows) on each page
        + '&amp;gid=0'; //first page
    var options = {
      headers: {
        'Authorization': 'Bearer ' +  ScriptApp.getOAuthToken()
      }
    }
    var Name = Invoice_Sheet.getRange(&quot;C12&quot;).getValue();
    var curDate = Utilities.formatDate(new Date(), &quot;GMT+1&quot;, &quot;dd/MM/yyyy&quot;)
    var pdfName = Name + &quot; - &quot; + curDate + &quot; - &quot; + &quot;Suds Invoice&quot;;
    var response = UrlFetchApp.fetch(&quot;https://docs.google.com/spreadsheets/&quot; + url_ext, options);
    var blob = response.getBlob().setName(pdfName + '.pdf');
  
    folder.createFile(blob);
  
  }
  </code></pre>