admin管理员组文章数量:1406937
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=[email protected] 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 -
(.png)
Generated PDF through WeasyPrint (.png)
本文标签:
版权声明:本文标题:django - Generate a PDF of a dynamically bound Angular webpage and allow it to be downloaded from the Dashboard page - Stack Ove 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745053248a2639781.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论