Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
136 views
in Technique[技术] by (71.8m points)

python - Different headers for different pages - Weasyprint PDF Generation

I am using Weasyprint library (version - 52.2) in Python to generate PDF. The following documents helps to add common header/footer for all the pages in the pdf.

https://weasyprint.readthedocs.io/en/stable/tips-tricks.html https://gist.github.com/nathandem/63f410d501d200cfa5613b38aaf74c44

The code calculates the height of header, footer ,and body and then it adjusts the margin based on the header's height.

However, my use-case is slightly different. I have no header for Page 1 and need to add a common header for the subsequent pages. Is there a way to change the margin for the first Page alone?

question from:https://stackoverflow.com/questions/65840568/different-headers-for-different-pages-weasyprint-pdf-generation

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...