2017-07-07 140 views
1

嘗試使用chrome-remote-interface Node js模塊創建pdf。當我嘗試將參數傳遞給printToPDF函數時,我得到的輸出與沒有參數的輸出相同。使用Node js和Google Chrome打印pdf

頁號:https://chromedevtools.github.io/devtools-protocol/tot/Page/

查找到printToPDF功能。

我的代碼用於打印pdf。

const pdf = await Page.printToPDF({landscape: 'true',displayHeaderFooter: 'true',printBackground: 'true',scale: '1.0',paperWidth: '8.5',paperHeight: '11',marginTop: '0.4',marginBottom: '0.4',marginLeft: '0.5',marginRight: '0.5',pageRanges: ""}); 

回答

0

的問題是,打印到PDF只能從60版這就是爲什麼它沒有工作

支持參數