Ok when im gonna make reports with Java I use iReport for JasperReports Template designs.
But with python the alternative is html2pdf – pisa.
It would be great to see an example of this.
Any hint would be appreciated.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The accounting software we are developing uses pisa to generate pdf reports. The process is like this:
StringIOobject to store the pdf and send its content via HttpResponse.HttpResponseobject should be set toapplication/pdfand useContent-Dispositionheader if you want to trigger download instead of displaying in the browser.Pisa uses some unique CSS properties to specify pdf related formatting (page-size, page-break etc). Their docs provide sufficient examples on this.
Pisa’s rendering of HTML/CSS can be quite a bit different from what we usually see in browser. For example, setting
border="1"on a<table>will give all cells of the table border, borders are always collapsed (border-collapse css attribute has no effect) etc.