Page 1 of 1

Delphi XE2 and restart on page count

Posted: Tue Sep 11, 2012 3:24 pm
by maggigisla
Hi ...

I'm trying to restart paging on rtf documents with pgnrestart but having some difficulties, I've been trying to follow http://www.trichview.com/forums/viewtopic.php?t=64 and http://66.225.228.153/~trichvie/forums/ ... php?p=9456 but no luck.
What I'm doing is to get rft files from a db and putting them into a richviewedit with rv.AddNL('\sect\pgnrestart', 1, 0); inbetween.

Is there another example I can look at ?

The code :
{code}
srveEditor.RichViewEdit.Clear;
srveEditor.RichViewEdit.Style.TextStyles.Clear;
srveEditor.RichViewEdit.Style.TextStyles.Add;
srveEditor.RichViewEdit.Style.TextStyles.Add.Options := [rvteoRTFCode];
srveEditor.RichViewEdit.Style.ParaStyles.Clear;
srveEditor.RichViewEdit.Style.ParaStyles.Add;
srveEditor.RichViewEdit.Style.ListStyles.Clear;
while not qQry.Eof do begin
try
lob := TLOBLocator.Create(Connection, otBLOB);
GetLetter(qQry.FieldAsInteger('LETTER'), lob);
srveEditor.RichViewEdit.LoadRTFFromStream(lob);
srveEditor.RichViewEdit.FormatTail;
iIdx := srveEditor.RichViewEdit.ItemCount-1;
iLengd := srveEditor.RichViewEdit.GetOffsAfterItem(iIdx);
srveEditor.RichViewEdit.SetSelectionBounds(iIdx, iLengd, iIdx, iLengd);
srveEditor.RichViewEdit.AddNL('\sect\pgnrestart', 1, 0);
finally
lob.Free;
end;
qQry.Next;
end;
{code}

Posted: Wed Sep 12, 2012 2:42 pm
by maggigisla
Anyone ?
Sergey Tkachenko ?

Posted: Wed Sep 12, 2012 4:13 pm
by Sergey Tkachenko
And what's wrong exactly?

Posted: Thu Sep 13, 2012 8:20 am
by maggigisla
Hi ...

What's wrong exactly is that the numbering does not restart, but if you open the document in ms word the numbering does restarts. So it looks like MS word does see the section break but the RichViewEditor not. Is there anything you see in the code that I'm doing wrong ? Should I do something else ?

Thanks for the assistance.
MG

Posted: Thu Sep 13, 2012 9:45 am
by Sergey Tkachenko
TRichView does not support sections yet, sorry.