Hi!
Is it possible to delete pages where only a header and a footer is shown? So I want to delete an empty Page.
Thanks Markus
Hi!
Is it possible to delete pages where only a header and a footer is shown? So I want to delete an empty Page.
Thanks Markus
Hi,
On such pages I would expect that there is one empty line, too. That empty line needs to be removed. That is not so easy to do, but this code should be a start:
var PaintPageRec: TWPRTFEnginePaintPages;
rtfpage: TWPVirtPage;
i : Integer;
par, par2 : TParagraph;
begin
i := WPRichText1.Memo.PaintPageCount-1;
while i>0 do
begin
WPRichText1.Memo.GetPaintPage(i, PaintPageRec, rtfpage);
par := rtfpage.FindFirstTextPar(a);
par2:= rtfpage.LastTextPar;
if (par<>nil) and (par=par2) then
begin
if par.Empty([], true) and (par.ParentPar=nil) then
par.DeleteParagraph
else if a>=par.CharCount-1 then
while (par.CharCount > 0) and par.IsSpace(par.CharCount - 1) do
par.DeleteChar(par.CharCount - 1);
end;
dec(i);
end;
WPRichText1.ReformatAll(false, true);
end;
Alles anzeigen
Hi!
Thanks a lot! It works!