Reputation: 101
I want to create a PDF out of HTML (What we are seeing in the screen) but NOT as Image. Image is working fine but doing the same for HTML, it is not capturing as in UI rather it is been different.
I am using jsPdf, html2canvas and Angular 5
Please let me know how to capture the HTML(as seen in UI) to PDF (not as Image).
Thanks vinod.
Upvotes: 0
Views: 1003
Reputation: 998
I use the native browser print function combined with a print stylesheet such as the one provided from bootstrap or you can write your own.
Just call this inside your method
print()
The print dialog will open and you can choose the Destination Save as PDF instead of choosing a printer.
Also make sure that the Background graphics is enabled also in the More Settings section.
Upvotes: 2