我需要Google表格的脚本,该脚本将以纵向模式在活动表格上打印单元格的选定区域。 我可以使用此代码
function printPdf() {
SpreadsheetApp.flush();
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var gid = sheet.getSheetId();
var pdfOpts = '&size=A4&fzr=false&portrait=false&fitw=true&gridlines=false&printtitle=false&shee tnames=false&pagenum=UNDEFINED&attachment=false&gid='+gid;
var row2 = 29;
var printRange = '&c1=0' + '&r1=0' + '&c2=7' + '&r2='+row2; // B2:APn
var url = ss.getUrl().replace(/edit$/, '') + 'export?format=pdf' + pdfOpts + printRange;
var app = UiApp.createApplication().setWidth(200).setHeight(50);
app.setTitle('Print this sheet');
var link = app.createAnchor('Download PDF', url).setTarget('_new');
app.add(link);
ss.show(app);
}
但是它的UiApp不再起作用。有人可以帮我编辑此部分吗?
谢谢