[dokuwiki] Re: Add page breaks in "printer friendly" version?

  • From: "Lavigne, Jesse" <lavigj@xxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Wed, 09 Aug 2006 14:19:08 -0400

Otto Vainio wrote:

Lavigne, Jesse wrote:
Is there a way to add page breaks to a page, so that when it is printed it will not interrupt things like paragraphs, etc?

You should find a way to add css "page-break-after" to your page

One option is to use <html></html> tags and put something like
<STYLE>
    P { page-break-after: always }
</STYLE>
to your page.

Also a pagebreak plugin would easy to create.

Otto
Otto,

Thanks for the reply. It's helped make a stressful day slightly less stressful. Here's what I did to have a temporary solution.

1. Enabled embedded html.

2. Added this snippet of code at the top of the page I am editing:

<html>
  <style>
     #pb {page-break-after: always }
  </style>
</html>

3. Inserted this snippet of code where I want the page to break while printing:

<html><p id="pb"/></html>


I see a couple of potential problems with this approach, but it seems to work OK with the *very* limited testing I have done.


Positive:
 * Seems to work fine with both IE and Firefox.
 * Very simple and quick to impliment

Issues:
* It will add an unneeded space between the page break location and the next item. I don't know if the browser will ignore that extra space because of the new page or not.
* Not as good as a plugin.



I took a quick look at the plugin documentation, but at this point it is beyond my technical ability with PHP, and I am too constrained for time to be able to learn the needed php, make the plugin, test, and impliment. Maybe in the future....


Thanks again,

- Jesse
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: