Printing a PDF file with Electron JS

后端 未结 5 1853
执笔经年
执笔经年 2021-02-04 00:37

I am trying to create an Electron JS app that has the purpose to print letter size PDFs.

This is my snippet of code for printing:

win = new BrowserWindow         


        
5条回答
  •  长发绾君心
    2021-02-04 00:55

    The easiest way to do this is to render the PDF pages to individual canvas elements on a page using PDF.js and then call print.

    I fixed this gist to use the PDF.js version (v1) it was designed for and its probably a good starting point.

    This is essentially what the electron/chrome pdf viewer is doing but now you have full control over the layout!

    
    
    
     
    
    

提交回复
热议问题