Javascript call programmatically the “Save as PDF” feature of Chrome dialog print

后端 未结 1 1355
清酒与你
清酒与你 2020-12-25 10:56

Google Chrome have the option \"Save as PDF\" when you enter the Print dialog or window.print(). The user need to choice this option in dialog to save the page as pdf.

相关标签:
1条回答
  • 2020-12-25 11:49

    Unfortunately there isn't any param you could pass to window.print(); and force it to print pdf unless there is a pdf driver plugin already present on the client's browser. There are plugins for firefox and IE (JS Print Setup and MeadCo Script respectively).

    You may want to look at MrRio/jsPDF, a tool to generate pdf files at client-side JS.

    0 讨论(0)
提交回复
热议问题