When printing a sheet with the print dialog (CTRL+P) a custom page size can be used.
I'm using Google App script to generate PDFs. How do I set the page size to a custom size and specify the dimensions? This is the code I'm using:
var exportUrl = url_base + 'export?exportFormat=pdf&format=pdf' +
'&gid=' + sheetTabId + '&id=' + ssID +
'&range=' + range +
'&size=A3' + // paper size - How do I use a custom size and specify the dimensions?
'&scale=4' +
'&portrait=false' +
'&sheetnames=false' +
'&printtitle=false' +
'&pagenumbers=false' +
'&gridlines=false' +
'&fzr=false' +
'&top_margin=0.0' +
'&bottom_margin=0.0' +
'&left_margin=0.0' +
'&right_margin=0.0' +
'&horizontal_alignment=CENTER' +
'&vertical_alignment=MIDDLE';
There is a similar question here: How to adjust as custom size margins and paper size in script to save google spreadsheet in PDF?, but the accepted answer doesn't actually answer the question...