Tags:
create new tag
view all tags

Question

Inserting HTML code for a Page Break doesn't work when I go to print the page. The standard page-break code starts with a HTML paragraph < p> statement but when the page is rendered, it looks like TWiki has closed it with an HTML end-paragraph < /p> statement, which apparently nullifies the page-break effect when the browser goes to print.

Is there any way to get a page break so when pages are printed they will break in certain spots (before tables or pictures, etc)?

Environment

TWiki version: TWikiRelease04x00x00
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: WinXP SP2
Web server: Apache 1.3.34
Perl version: 5.8.7-5
Client OS: WinXP
Web Browser: Firefox
Categories: Performance

-- JoshuaJohnston - 23 Mar 2006

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

HTML unfortunately does not have a page break concept. the <p> tag identifies paragraphs. I wish myself HTML had a "break page here if needed" tag.

-- PeterThoeny - 23 Mar 2006

Funny that this should come up since I needed it myself not two days ago. What I found is that there is a CSS syntax for forcing a pagebreak. Here's one general reference on the subject: http://www.htmlgoodies.com/beyond/css/article.php/3470341#break

Here's a example syntax for use with html style attibute:

<p style="page-break-before: always">test text in the paragraph</p>

I personally prefer to remember a TWiki tag than this type of syntax which I don't use very often, so I defined a site-wide variable for PAGEBREAK:

   * Set PAGEBREAK = <p style="page-break-before: always"> </p>

This worked quite nicely for me. For some reason, it did not work with the PatternSkin print view but did work with the basic print view as well as the "plain" view. I read somewhere that browser support for this feature is somewhat spotty but it worked on all my (Mac) browsers.

-- LynnwoodBrown - 23 Mar 2006

Yeah, that's the HTML code I was referring to. I'm not sure what's going on with it when I try and use it, but it's a little weird. I did some more research and maybe it's something Firefox is doing(?). If I put the statement in open ended without closing it with a </p> statement then the code actually does get rendered right (TWiki isn't actually closing it like I thought). Firefox shows this when viewing the source with Ctrl+U option, but when selecting the page and viewing the source selection, it shows it closed. I don't get it. And it still won't print right frown Oh well.

-- JoshuaJohnston - 27 Mar 2006

Out of curiousity, which print view are you using? As i mentioned, the PatternSkin print view did not work with this method. But if you append the url for the topic with "?skin=print" or "?skin=plain" it does work.

-- LynnwoodBrown - 27 Mar 2006

Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2006-03-27 - LynnwoodBrown
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.