Page 1 of 1
convert Page Break and Section Break to Paragraph Break
Posted: Fri Nov 02, 2012 8:12 am
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
Posted: Fri Nov 02, 2012 12:23 pm
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;
Posted: Fri Nov 02, 2012 2:08 pm
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
Posted: Fri Nov 02, 2012 2:10 pm
by Sergey Tkachenko
Not soon, sorry. There are other works with higher priority, so I am afraid in 2013 sections will not be implemented.