Delphi XE2 and restart on page count
Posted: Tue Sep 11, 2012 3:24 pm
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}
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}