Exporting PDF with jspdf not rendering CSS

后端 未结 5 1785
深忆病人
深忆病人 2020-11-27 18:13

I am using jspdf.debug.js to export different data from a website but there are a few problems, I can\'t get it to render the CSS in the exported PDF and if I have an image

5条回答
  •  感动是毒
    2020-11-27 19:04

    jspdf does not work with css but it can work along with html2canvas. You can use jspdf along with html2canvas.

    include these two files in script on your page :

    
      
      
    

    You need to download script files such as https://github.com/niklasvh/html2canvas/releases https://cdnjs.com/libraries/jspdf

    make clickable button on page so that it will generate pdf and it will be seen same as that of original html page.

    Download PDF  
    

    It will work perfectly.

提交回复
热议问题