0

Im using this script that creates a pdf of an specific sheet

     var sheetName = "xxxx"   
  var sS = SpreadsheetApp.openById("xxxx");
  var sheets = sS.getSheets();
  //var ssNewName = sS.getRange("d2").getValue();
  var name = sheet.getRange("r3").getValue();
  
  for (var i = 0; i < sheets.length; i++) {
    if (sheets[i].getSheetName() !== sheetName) {
      sheets[i].hideSheet()
    }
  }
  var newFile = DriveApp.createFile(sS.getBlob());
  for (var i = 0; i < sheets.length; i++) {
    sheets[i].showSheet()
  }
 newFile.setName(name);

It works, but there are cases when i need a different size, and its only saved in letter size, you know a way to change the size or to fith with the document? All your answers are appreciated!

Rubén
  • 34,714
  • 9
  • 70
  • 166
  • Can you provide more clarification on what you mean by this specifically? `and its only saved in letter size, you know a way to change the size or to fith with the document?`. A minimal reproducible example could also be better in order to have a full understanding of what you are trying to accomplish. – Fernando Lara Jan 04 '23 at 20:56
  • Sure, let me explain, in this sheets i have a kind of receipt, using this script, when it creates the pdf, the receipt looks very small, and i want it bigger so you can se clearly all the information, i have looking how can i solve this, and find this script – Clown Aspirant Jan 05 '23 at 14:06

0 Answers0