Generate a PDF of a dynamically bound Angular webpage and allow it to be downloaded from the Dashboard page

I have a project made with Angular and Django and MongoDB as database.
I have a page at http://localhost:4200/#/print/layout
This Print-Layout page is properly getting all the data from an API which brings data from Backend.
If i want to Print/Save as PDF the webpage of Print-Layout page, i can do Ctrl + P for that.
But now i am thinking of putting a Download PDF button at this url - http://localhost:4200/#/project

Here, i will give all the necessary parameters like /?plant_id=3&project_id=121&username=pratikpol@gmail.com and other headers which are required.

Even without being on that Print-layout page or viewing that Print-Layout page, can i download the webpage as PDF ???
I just want the Ctrl + P functionality to work at the Download PDF button.

I want to do all this on Frontend ( Angular ) only, i cant use Backend because in Print-Layout page, I have very very complex SVGs, and some other complex Styling which are being properly handled in Angular.

I have tried through Backend, and am using WeasyPrint Python library which converts HTML to PDF.
Thus, i had to write same to same Django HTML template as the Angular HTML template.
When the HTML file is properly made, all the data has been binded, then WeasyPrint is used to convert the HTML to PDF.
But then my complex SVGs are not being properly made with WeasyPrint.

Django HTML -
(https://i.sstatic.net/JpaBc1y2.png)

Generated PDF through WeasyPrint (https://i.sstatic.net/YjmZYmkx.png)

Вернуться на верх