HardPageBreak


Testing a hard page break.

This only works in print-mode, use this link: HardPageBreak?action=print

There should be a page break after this sentence.

This sentence should be on a new page.

Date: Wed, 19 Oct 2005 13:32:19 -0500
From: Chris Cox <ccox@airmail.net>
Newsgroups: gmane.comp.web.wiki.pmwiki.user
Subject: Re: hard page break in print view

Russ Fink wrote:
> Hello,
> 
> What are my options for causing a hard page break in print view for
> PmWiki 2?  Unlike the breakpage recipe, I'm not interested in breaking
> the page in the normal web view.  What I want is the user to see all one
> continuous page when viewing on the web, but when they go to print view,
> I need them to have sections starting on a fresh page.
> 
> This capability is known as "hard page" and "page break" to word
> processing users.

I think the page-break-after, page-break-before, etc.
CSS items are CSSv2.  But maybe they are used everywhere... I haven't
tried.  If so you could create an item with those attributes or use
a div to get make it happen.  You could turn it into your markup
even.

(:div style='page-break-after:always;':)
(:divend:)

To my knowledge there is no standard PmWiki markup that attempts
to do this right now.

I test the above just now and seemed to work on Firefox anyhow.
Date: Wed, 19 Oct 2005 14:10:53 -0500
From: Patrick R. Michaud <pmichaud@pobox.com>
Cc: pmwiki-users@pmichaud.com
Newsgroups: gmane.comp.web.wiki.pmwiki.user
Subject: Re: hard page break in print view

On Wed, Oct 19, 2005 at 03:04:25PM -0400, Russ Fink wrote:
> Thank you, that worked like a charm.  I echo your sentiment, is there some 
> way to add this easily into a wiki markup, perhaps a style, (even a 
> cookbook recipe) so that I can say something like,
> %hardpage%
> or even
> (:hardpage:)
> ?

Try:

    $WikiStyleCSS[] = 'page-break-before';
    $WikiStyle['hardpage'] = 
      array('page-break-before' => 'always', 'apply' => 'block');

Then you can use %hardpage% on any element to force a page break
before it, as in

    !! %hardpage% Why PmWiki is the best package ever

Pm


 0: 00.00 00.00 config start
 1: 00.03 00.01 config end
 2: 00.26 00.20 MarkupToHTML begin
 3: 00.27 00.21 MarkupToHTML end
 4: 00.28 00.22 MarkupToHTML begin
 5: 00.29 00.22 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
 6: 00.29 00.23 ReadApprovedUrls SiteAdmin.ApprovedUrls end
 7: 00.30 00.23 MarkupToHTML end
 8: 00.30 00.23 MarkupToHTML begin
 9: 00.30 00.24 MarkupToHTML end
10: 00.30 00.24 now
Peak memory: 3,748,880 bytes