Forum How do I...?

Blank page between named pages?

ssundahl
I have a several page document that needs multiple different headers. I currently have the first page that isn't actually utilizing a proper header, just a small margin with a second of text at the top. Then I have two different names pages that follow it, each needing its own header of varying size because those named pages can be multiple pages long. Prince is inserting a blank page (with no header) between the two named pages.

Is this expected? Am I doing this the correct way?


@page {
size: US-Letter;
margin-left: 0.3in;
margin-right: 0.3in;
margin-top: 0in;
margin-bottom: .75in;

@bottom-right { content: "Page " counter(page) " of " counter(pages); vertical-align: bottom; font-size: 10px; margin-bottom: 5mm; }
@bottom-left { content: "A COMPANY"; vertical-align: bottom; font-size: 10px; margin-bottom: 5mm; }
}

@page interp {
margin-top: 1in;
margin-left: .5in;
margin-right: .5in;
@top { content: flow(header); }
}

@page supplementala {
margin-top: 2in;
margin-left: .5in;
margin-right: .5in;
@top { content: flow(header); }
}

mikeday
Perhaps there is some content in the document that just has "page: auto" instead of the named pages?
ssundahl
I don't have page: auto anywhere. Here's a simple example of how I'm creating a named page with a specific header. I do it about 7 times and after each of the 7 times, I get a blank page (it's not entirely blank. It contains the footer from the default @page {} styling. An extra page break is happening for some reason.


<div class="methods-header-container">
<div class="methods-header width-100 relative bg-gray">
<span class="header-span">Methods</span>
</div>
</div>

<div class="width-100 methods">

</div>

@page methods {
margin-top: 2in;
margin-left: .5in;
margin-right: .5in;
@top { content: flow(header); }
}


.methods { page: methods; }
.methods-header { padding: 8px 0; display: inline; height:30px; }
.methods-header-container { flow: static(header); }
mikeday
Does any content follow the methods div?

It might help to put the header div inside the methods div, also.
ssundahl
After the methods div is another div that follows the exact same structure and has its own named page. I do this 7 times in all. Only the last named page does not have an extra page break. I've attached the last 5 pages of the pdf, which includes 3 of these sections.
  1. example.pdf37.5 kB
mikeday
Difficult to tell, I'm afraid. There can be many styling issues involved. Perhaps you could attach (or email me at mikeday@yeslogic.com) a copy of the HTML+CSS that causes the problem?
ssundahl
I'll email you the files. Thanks.
mikeday
This issue turns out to be caused by U+FEFF characters found between <div> elements, perhaps a side effect of concatenating multiple HTML files. They can be removed using the prince-text-replace property, which fixes the problem.
ssundahl
I appreciate the help with this. That fixed it.