Recent

Author Topic: Entering Page Breaks  (Read 1846 times)

rick2691

  • Sr. Member
  • ****
  • Posts: 375
Entering Page Breaks
« on: September 22, 2016, 02:19:10 pm »
I have found that my ViewPage (Print Preview) can work with Page Breaks that have been set by another editor. But I can't find a way to insert a Page Break by coding. Is there any method that is available?

Rick
Windows 10, LAZ 1.6.4, FPC 3.0.2, SVN 54278, i386-win32-win32/win64, forms use windows unit

rick2691

  • Sr. Member
  • ****
  • Posts: 375
Re: Entering Page Breaks
« Reply #1 on: September 22, 2016, 03:07:58 pm »
Never mind. I just figured it out...

Code: Pascal  [Select]
  1. procedure TCmdForm.MnuBreakClick(Sender: TObject);
  2. var SS: TStringStream;
  3. begin
  4.   SS:= TStringStream.Create('{\rtf1 {\page }}');
  5.   try PutRTFSelection(PageMemo, SS);
  6.       finally
  7.       SS.Free;
  8.       end;
  9. end;
  10.  

PutRTFSelection is the method posted in the thread titled:    
"Inserting, Saving and Loading Images"

Rick
Windows 10, LAZ 1.6.4, FPC 3.0.2, SVN 54278, i386-win32-win32/win64, forms use windows unit