convert Page Break and Section Break to Paragraph Break

General TRichView support forum. Please post your questions here
Post Reply
Riley Meadows
Posts: 2
Joined: Fri Nov 02, 2012 7:54 am

convert Page Break and Section Break to Paragraph Break

Post by Riley Meadows »

Hi.
Is there any way to convert any Page Break and any Section Break to Paragraph Break? I mean by using code (programatically)...
Thank you.

Regards, Riley
Sergey Tkachenko
Site Admin
Posts: 17564
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

TRichView does not support section breaks yet.
Page breaks are already in places of paragraph breaks (or in places of line breaks inside paragraph), so all you need is removing page breaks.

1) You can simply assign RVPrint.IgnorePageBreaks = True to ignore all explicit page breaks.

2) The code for removing all page breaks:

Code: Select all

procedure RemovePageBreaks(RVData: TCustomRVData);
var i, r, c: Integer;
   table: TRVTableItemInfo;
begin
  for i := 0 to RVData.ItemCount-1 do begin
    RVData.PageBreaksBeforeItems[i] := False;
    if RVData.GetItemStyle(i)=rvsTable then begin
      table := TRVTableItemInfo(RVData.GetItem(i));
      for r := 0 to table.RowCount-1 do begin
        table.Rows[r].PageBreakBefore := False;
        for c := 0 to table.ColCount-1 do
          if table.Cells[r,c]<>nil then
            RemovePageBreaks(table.Cells[r,c].GetRVData));
      end;
    end;
  end;
Call:

Code: Select all

  RemovePageBreaks(RichViewEdit1.RVData);

end;
Riley Meadows
Posts: 2
Joined: Fri Nov 02, 2012 7:54 am

Post by Riley Meadows »

It works for page breaks, thank you.
Do you have a timetable for when you will also implement Section Breaks?

Regards, Riley
Sergey Tkachenko
Site Admin
Posts: 17564
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Not soon, sorry. There are other works with higher priority, so I am afraid in 2013 sections will not be implemented.
Post Reply