Is it possible to export HTML to PDF or create PDF in AngularJs without using JSPDF, Phantom, etc.

I need to export any HTML (e.g. c div) to PDF using only AngularJS. I searched a lot, but could not find a solution for creating PDF files in AngularJS without using libraries like JSPDF, phantom, etc.

Is there any directive or event for generating PDF in AngularJS? I am not looking for a PDF viewer. I am looking for a PDF generation.

+4
source share
1 answer

I know this is an old post, and maybe this is not quite what you are looking for, but maybe it will help you (or others) anyway:

var divContent = document.getElementById('yourDiv').innerHTML,
    printWindow = window.open("", "", "width=800, height=600");

printWindow.document.write(divContent);
printWindow.print();

, HTML PDF. , .

+1

Source: https://habr.com/ru/post/1608675/


All Articles