Skip to content
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

CSS: page-break-before "always" -- slightly wrong implementation (in PDF) #1

Closed
haberbyte opened this issue Sep 13, 2010 · 3 comments
Closed

Comments

@haberbyte
Copy link

If you create an xhtml file that has a content something like this:

<style> div.chapter { page-break-before: always; }
Test
--- The generated PDF creates an empty page. The div starts at page 2. However, according to the CSS3 paged-media specs, a page-break-before: always should not create empty pages. Neither should page-break-after: always! It is correct that you always break to a new page. But creating "blank" pages is an exception to this rule. This causes some annoyances and it would be great if this gets fixed!!
@haberbyte
Copy link
Author

Sorry, next try.

If you create an xhtml file that just has a DIV that has the CSS property "page-break-before: always". The generated PDF will have 2 pages. An empty page, and a second page with the content of the DIV.

This might seem correct, HOWEVER...the CSS3 specs say that neither page-break-before nor page-break-after properties should cause the creation of empty pages.

It would be great if this case would get fixed!

@pbrant
Copy link
Member

pbrant commented Nov 4, 2010

Yeah, I'm afraid "empty" is not entirely trivial to detect. I think we don't create blank pages if the block element in question is right at the top of the page (with no intervening margin). 's margin might be interfering with that. It's also possible I removed that code since it was such a poor approximation of the spec.

@pdoubleya
Copy link
Contributor

Moved to our official issue tracker as issue http://code.google.com/p/flying-saucer/issues/detail?id=139. Please continue discussion there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants