Which URL query parameters control the Google Docs spreadsheet export endpoint?

I need guidance on URL query options for exporting a Google Sheet to PDF using the spreadsheet export endpoint. Alternative code example:

function generatePdf(docKey, sheetObj, pdfLabel) {
  const rowStart = 0, colStart = 0, rowEnd = 20, colEnd = 10;
  const pdfUrl = 'https://docs.google.com/spreadsheets/d/' + docKey + '/export' +
    '?format=pdf&size=letter&portrait=false&gridlines=false&fitw=true' +
    '&gid=' + sheetObj.getSheetId() + '&r1=' + rowStart + '&c1=' + colStart + '&r2=' + rowEnd + '&c2=' + colEnd;

  const fetchOptions = { method: 'GET', headers: { Authorization: 'Bearer ' + ScriptApp.getOAuthToken() } };
  return UrlFetchApp.fetch(pdfUrl, fetchOptions).getBlob().setName(pdfLabel + '.pdf');
}

hey, check out the google dev docs. i found that tryin different variations sometimes works better. some params like gridlines and fitw are kinda buggy, so testing each is good luck!

The URL query string for exporting a Google Sheets document essentially combines several parameters that device the output type, layout, and specific content range. Based on my experience, parameters such as format, size, portrait, gridlines, and fitw tend to be the main ones used. Additionally, when specifying a particular sheet, the gid parameter becomes mandatory. It is also possible to define the export range using parameters like r1, r2, c1, and c2. Testing remains important because occasional minor variations or undocumented behaviors have encountered on different spreadsheets.