-
-
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
Inconsistent headers with named pages and running headers #507
Comments
Can't reproduce this bug with weasyprint 0.42 |
I can, what a strange issue. |
Justification of the paragraphs' first lines is also broken. |
At least I've fixed that (and added a test). |
Managed to reproduce the missing headers: It only happens on pages where the top line is the first line of a paragraph. WeasyPrint applies I expected to achieve a cascade and consistent behaviour by moving the Workaround: Wrapping with an inner
|
Thanks a lot for your really helpful issue, I'll try to be clear about what I've done and how to get what you want.
@@ -73,8 +81,7 @@
page-break-before: right; }
div.chapter, div.appendix {
- padding-top: 10rem;
- page: chapter; }
+ padding-top: 10rem; }
div.chapter p, div.appendix p {
text-indent: 1cm;
padding: 0;
@@ -94,6 +101,7 @@
font-size: 1.5em; }
h1 {
+ page: chapter;
text-align: center; }
h1.element-title {
padding-bottom: 10rem; } You can also remove headers and footers from empty pages: @@ -53,6 +53,14 @@
@top-left {
content: ""; } }
+@page :blank {
+ @bottom-center {
+ content: ""; }
+ @top-right {
+ content: ""; }
+ @top-left {
+ content: ""; } }
+
body {
hyphens: manual; } I hope that it'll be helpful. Have fun with WeasyPrint! |
Yes, that's what I thought: There shouldn't have been headers at all. @liZe added #562 'named pages with pseudo-class' to the 43 milestone.
|
I just had a chance to integrate the code into my mfgames-writing-js and it worked beautifully (though there were some differences in how I implemented the page breaks). Between this and the inability to reset page numbers, I ended up having to generate 3 PDFs for every chapter in my novels with the previous implementation.
Then I combined everything the two previous ones together. page1 + pageN. The combine those to the previous chapters to build up the document part-by-part. (So 3N PDFS where N is the number of chapters.) With the changes for this, I got it down to 2. Not 2N, 2. That also made the builds 6x faster for my latest published novel. Thank you, this has been very helpful and I appreciate all the help you put into it. |
Salutations. I was finally trying to implement #57 in my system and I encountered a strange difficult. I have just as simple set of
div.chapter
objects with a running header that has the author and title except for the first page of each chapter, which doesn't. When I run this against the latest (6971959), the headers inconsistently disappear on the page.I have attached a sample which demonstrates this. This is from Frankenstein. The letters all have the headers I expect, but the first page after chapter doesn't, however, I don't have anything different with those so I'm not sure why it disappeared. Likewise, pages 23-34 (the third and fourth page of chapter 2) are doing this.
The text was updated successfully, but these errors were encountered: