Tables Width RTF error

General TRichView support forum. Please post your questions here
Post Reply
israelgs
Posts: 25
Joined: Mon Oct 23, 2006 11:46 am

Tables Width RTF error

Post by israelgs »

Hi,

I am observing that when a table is added to a TRichView document, or pasted from Word, the dimensions are set to Width: auto by default.

If the document is saved in RTF format, the tables are off the sheet. It is as if you did not take into account the right margin of the document. This is solved if the width is set manually (or just put Width: percent 100%).

The question is ... can you set the tables to be 100% wide by default? How could we do the same for tables that are pasted from Word?

Thank you.

PD: I used TRichView and TScaleRichView in latest versions.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Tables Width RTF error

Post by Sergey Tkachenko »

You can process OnItemAction event:

Code: Select all

procedure TForm3.RichViewEdit1ItemAction(Sender: TCustomRichView;
  ItemAction: TRVItemAction; Item: TCustomRVItemInfo;
  var Text: TRVUnicodeString; RVData: TCustomRVData);
begin
  if (ItemAction = rviaInserted) and (Item is TRVTableItemInfo) and
    (TRVTableItemInfo(Item).BestWidth = 0) then
    TRVTableItemInfo(Item).BestWidth := -100;
end;
But I do not think that this is a good idea.
Post Reply