问题描述
在 Chrome 中使用 Print to Pdf 或 iOS 中的各种 Share Sheet 元素转换 this 等网页时,pdf 输出格式为单个页面,如下所示:Output from Print to Pdf 或 iOS Share工作表
在 Google Apps Script 中,使用以下代码将 html 转换为 pdf 会生成一个两页的 pdf:输出来自 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");
}
在使用 blob.getAs() 输出为前者时,是否有一种控制格式的方法,或者我可以在 Apps 脚本中使用更好的方法将网页转换为 pdf?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)