Forum > RichMemo

Page Break in Rich Memo

(1/1)

Badger:
Is there any way to insert a page break in rich memo so that when the Rich memo contents are pasted to the clipboard and then the clipboard pasted into a word processor such as LibreOffice, the page break shows up on the word processor?

paweld:
chr(12), eg.
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.AddPageBreakClick(Sender: TObject);begin  RichMemo1.Lines.Insert(RichMemo1.Lines.Count div 2, #12);  //add a pagebreak in the middle of text  RichMemo1.CopyToClipboard;  end;   

Badger:
Thanks - works perfectly.
Just for completeness, how would you remove the page break?

paweld:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---RichMemo1.Lines.Text := StringReplace(RichMemo1.Lines.Text, #12, LineEnding, [rfReplaceAll]);  //remove all pagebreaks 

Nicole:
2 more code snippets go into my library...

Navigation

[0] Message Index

Go to full version