tags:

views:

121

answers:

1

I have written an application that uses the Tinymce editor. The administrator can create templates, which are then subsequenty loaded by the users. Between fetching the template from the database and inserting it into the editor, I perform a merge with the current record. This all works fine.

I am however having problems with the printing of documents using page breaks. They seeem to be ignored.

In the .init file I have the page break plugin loaded, and have also set the following

pagebreak_separator : "<!--pagebreak-->"

Inserting a page break will place a horizontal line in the editor, with the text <!--pagebreak-->". Looking at the source code (html) I can see that the has been inserted, but when I try to print a document which I have split in half using the page break, it seems to ignore it.

To my surprise, this posting

http://tinymce.moxiecode.com/punbb//viewtopic.php?pid=56419

seems to suggest that the insertion of a line break does nothing more than insert a line of of html code. Is this correct? This being the case can someone suggest how I go about this please.

FYI I am using the jquery version of TinyMCE.

Thanks

+1  A: 

You'll want to replace <!-- pagebreak --> with an actual element, as page-breaking itself is done with CSS. Try <span style="page-break-before: always;"></span>.

Xiong Chiamiov
Ah, thanks very much for pointing me in the right direction. I've seen some people suggesting the use of clear="all" on the end of the style statement as well. I'll have a play. Thank you.
Dave
I suppose I should've noted that I haven't tried this myself, so I'm interested in your results.
Xiong Chiamiov
<div style=\"page-break-before: always; clear:both\"/></div> works for me, thanks for your help.
Dave