Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Packages and Libraries
»
RichMemo
»
Page Break in Rich Memo
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
IRC channel
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Compilation error with CP...
by
Blaazen
[
Today
at 02:48:53 am]
Freeing at destructor TLa...
by
wp
[
Today
at 01:28:43 am]
centered text in progress...
by
wp
[
Today
at 01:08:54 am]
Introducción al pascal mo...
by
GAN
[March 28, 2023, 11:55:33 pm]
JSON Schema - JSONpath
by
paweld
[March 28, 2023, 10:57:23 pm]
Help with tsearchrec
by
paweld
[March 28, 2023, 10:54:09 pm]
Limit shown hint/help to ...
by
dsiders
[March 28, 2023, 10:52:22 pm]
Find text in memo gives m...
by
Bart
[March 28, 2023, 10:44:13 pm]
WebLaz corrections
by
PascalDragon
[March 28, 2023, 10:01:05 pm]
Initialization of array o...
by
simone
[March 28, 2023, 09:38:55 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Page Break in Rich Memo (Read 358 times)
Badger
Full Member
Posts: 134
Page Break in Rich Memo
«
on:
March 17, 2023, 09:58:03 am »
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?
Logged
Badger
If at first you don't succeed - you're running about average!
I'm using Windows 10 Lazarus v2.4.4 FPC 3.2.2 Win 32/64
paweld
Hero Member
Posts: 630
Re: Page Break in Rich Memo
«
Reply #1 on:
March 17, 2023, 02:06:01 pm »
chr(12)
, eg.
Code: Pascal
[Select]
[+]
[-]
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
;
Logged
Best regards / Pozdrawiam
paweld
Badger
Full Member
Posts: 134
Re: Page Break in Rich Memo
«
Reply #2 on:
March 18, 2023, 05:24:36 am »
Thanks - works perfectly.
Just for completeness, how would you remove the page break?
Logged
Badger
If at first you don't succeed - you're running about average!
I'm using Windows 10 Lazarus v2.4.4 FPC 3.2.2 Win 32/64
paweld
Hero Member
Posts: 630
Re: Page Break in Rich Memo
«
Reply #3 on:
March 18, 2023, 08:49:00 am »
Code: Pascal
[Select]
[+]
[-]
RichMemo1
.
Lines
.
Text
:
=
StringReplace
(
RichMemo1
.
Lines
.
Text
,
#12
,
LineEnding
,
[
rfReplaceAll
]
)
;
//remove all pagebreaks
Logged
Best regards / Pozdrawiam
paweld
Nicole
Hero Member
Posts: 742
Re: Page Break in Rich Memo
«
Reply #4 on:
March 18, 2023, 11:02:42 am »
2 more code snippets go into my library...
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Packages and Libraries
»
RichMemo
»
Page Break in Rich Memo
TinyPortal
© 2005-2018