When converting a webpage such as this using Print to Pdf in Chrome, or from various Share Sheet elements in iOS, the pdf output is formatted to a single page like this: Output from Print to Pdf or iOS Share Sheet
In Google Apps Script, converting the html to pdf using the code below results in a two page pdf: Output from blob.getAs("application/pdf")
function mwe() {
var url = "https://www.theguardian.com/crosswords/quiptic/1102/print"
var html = UrlFetchApp.fetch(url)
var blob = html.getBlob();
var pdf = blob.getAs("application/pdf");
DriveApp.createFile(pdf).setName("example");
}
Is there either a way of controlling the formatting when using blob.getAs() to output as the former, or a better method I can use in Apps Script for converting a webpage to pdf?