File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Double Page break Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Double Page break" Watch "Double Page break" New topic
Author

Double Page break

Kin Ng
Greenhorn

Joined: May 06, 2005
Posts: 16
I'm using this tag for generating page breaks for printing..
<!-html text -->
<br style="page-break-after:always;"></br>
<!-html text -->
most of the time it works fine...
However...something goes wrong when the text before
the break actually filled out one full page.
It causes the break to appear as the first tag in the second page,
and it generated a page break at the beginning of the page.
Thus, I'm now having an extra blank sheet in between.
page 1. some text
page 2. blank
page 3. some text

Is there anyway that i can specify the page break so that it
only generates a page break when it's not at the beginning of page??

Thanks for your help guys.....

pn
[ October 04, 2005: Message edited by: Bear Bibeault ]
Garann Means
Ranch Hand

Joined: Jan 28, 2002
Posts: 214
You might want to look into page-break-before instead of page-break-after and/or auto instead of always. If you can't get it to work with some combination of those attributes, I'd say it's most likely a problem with the browser. You could also try this for your break:

Kin Ng
Greenhorn

Joined: May 06, 2005
Posts: 16
Thanks for your response.

auto didn't give me any page break at all.

and "page-break-after:always;page-break-before:avoid"

produce the same result. i.e. a blank page

=(
Garann Means
Ranch Hand

Joined: Jan 28, 2002
Posts: 214
The only other thing I can think of is to maybe add display:inline or line-height:1px or other attributes to make the break take up less space on its own. Good luck...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Double Page break