I added a new button to FCKEditor that inserts a page break like so:
<br class="breakhere">
If you look at the source in the FCKEditor, it shows up correctly and when I convert the page to PDF, the page break is there.
My problem though is that there is nothing to indicate that there is a page break (or that one was inserted) in the default editor view. Is there some way to make this appear visible here so that the user can see that they have insert a page break.
I guess my other option would be to insert something like [PAGEBREAK] and then replace that before converting the FCKEditor content to a PDF.
<br class="breakhere">
If you look at the source in the FCKEditor, it shows up correctly and when I convert the page to PDF, the page break is there.
My problem though is that there is nothing to indicate that there is a page break (or that one was inserted) in the default editor view. Is there some way to make this appear visible here so that the user can see that they have insert a page break.
I guess my other option would be to insert something like [PAGEBREAK] and then replace that before converting the FCKEditor content to a PDF.
Re: Display something for a page break.
Hey there,
you're in the right way...
I use
InsertHtml("<hr name='pagebreak'/>");
and then replace it, when generating the pdf, with the following regexp:
$html = preg_replace("/<hr\sname=\'pagebreak\'\/>/", "<div style='page-break-after:always'><span style='DISPLAY:none'> </span></div>", $html);
So, the user can see a line (hr) in the editor (you can also play with styles, e.g. giving the <hr> element background color or height);
However, there is a BIG PROBLEM that I'm facing in these days (i'm getting crazy...): when you insert any line (e.g. pressing enter) before the pagebreak, you cause the <hr> element to move down. So the page break results in a different position...
I hope these few lines can help you, but I also hope that someone can give me any ideas...
Re: Display something for a page break.
Use '<hr class="pagebreak" />', and set your CSS to:
@media print {
hr.pagebreak {
visibility: hidden;
page-break-after: always;
}
}
You'll get a visible line on-screen, and a physcial page break on media, minus the line.