-
-
Notifications
You must be signed in to change notification settings - Fork 711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
printable report & css #741
Comments
Hi @eregnier!
😄
What you can put in page margin boxes is currently limited in CSS, and you often have to use CSS tricks to get what you want. You can study the report sample and see how to get background colors and dynamic content for example. Removing margins is possible too. Other features (mixing regular, bold and italic text for example) are not possible in margin boxes. You may find useful tricks in #92, but you'll probably meet other limitations. If studying the report sample and reading #92 is not enough, you can post real use cases here, we'll try to find a way or another to solve your problems. |
Hey @liZe, Thank you for this first answer. Here is what I did as sample project hoping you'll understand better my issues :
My blocking points are :
{
"pages": [
{"title": "Page 1"},
{"title": "Page 2"}
]
} The real issue here is to repeat the header and the footer on each page with the appropriate content depending on the current json document that is iterated. Thank you for any hint / recommendation that you may bring me for this. I am really close to use weasyprint in production and I would really love to do so. PS: Sorry for the poor html and css content, I had to downgrade the original documents I am working on. |
I read again your answer @liZe, It seems that #92 partially answers my questions. I don't know if there is something to do such as a custom pagination (droppable plugin ?) system for weasy print that walks outside CSS standards that would make weasyprint user simpler to implement paginated content. But I think this is not the philosophy of this project as well. At the moment, I am quite blocked by these limitations to be fully confident tu use weasyprint on our side. If there is any chance that these problematics would evolve in the future in any way, I would enjoy use weasyprint for sure ! You may close the issue if there is no more to add about my specifics need in my usecase. Thank you for your time, again. |
Hello @eregnier, Thank you, it's easier for me to understand what you want with this sample. It would be perfect with a JSON sample and the matching PDF document looking as you ideally what (made with LibreOffice or any other tool). The features you have in your headers and footers (color, background color, bold) can easily be done with margin pages, so you won't have to fight with content under the footer (blocking points 1 and 2). I don't fully understand your third point, but I'll get it with the JSON and the PDF 😄. |
Thank you liZe for your help. This issue is solved on our side. |
Hi @liZe ,
Thank you for this project (I was at your conference at pycon 2018).
I am currently starting using weasyprint and it is really easy to use.
However, I am falling in the common css print pitfalls one by one.
I have to print paginated reports. I can generate content from json + jinja2 This is really cool.
However, and I know this is a bit out of the scope of weasyprint, I wonder where I should start to manage my report display properly.
I have reports where I have styled headers and footers (need css) and they must display pagination information (page/total). I already bruteforced the web and my code editor to try many combinations of
or some
And such.
I am at a point where I really wonder if it is possible to have stylized headers and footer (background color , dynamic content , bold text , no margin ...) and dynamic content that have their headers and footer accordingly.
I just wanted from you (or any other advised user) that you give me hints where to go or just stopping me soon if possible because I think you already spent a lot of time with these problematics. I love web, but I cannot really read entire css specs at the moment (child / taste / job dues dates).
Thank you for any help and/or thank you for your work.
N.B : I think if I find solution , I may write some documentation (a guide) for weasy print for such problems.
The text was updated successfully, but these errors were encountered: