Page 1 of 1

RTF import/export and trrh / absolute table row height

Posted: Fri Jan 08, 2021 8:06 am
by bastian.turcs
In RTF, the row height of a table is described via the

Code: Select all

\trrh
control word, followed by a number. If the number is negative, the table row height is absolute, otherwise the row height at least the specified value or increased if the text of the row requires more space. Unfortunately, if I do a load/save from rtf, absolute row heights are not preserved. Example:

Code: Select all

\trowd\trql\ltrrow\trrh-283\trpaddft3\trpaddt0 .....
is saved as

Code: Select all

\trowd\trgaph0\trleft0\trrh285\trpaddl0 ....
Can I change that behaviour so that absolute row heights are preserved? I did not find any published properties related to row height in the TRVTableRow class.

I'm using a purchased TRichView 16.10.4 and the following code to initilialize my view:

Code: Select all

  ADoc := TRichViewEdit.Create(Self);
  ADoc.Style := TRVStyle.Create(ADoc);
  ADoc.Parent := Self;
  ADoc.AnimationMode := rvaniDisabled;
  ADoc.DoInPaletteMode := rvpaCreateCopies;
  ADoc.RTFReadProperties.TextStyleMode := rvrsAddIfNeeded;
  ADoc.RTFReadProperties.ParaStyleMode := rvrsAddIfNeeded;
  ADoc.RTFReadProperties.ReadDocParameters := true;
  ADoc.RTFReadProperties.SkipHiddenText := false;

  ADoc.RVFOptions := [rvfoSavePicturesBody, rvfoSaveControlsBody, rvfoSaveBinary, rvfoSaveTextStyles,
    rvfoSaveParaStyles, rvfoSaveDocProperties, rvfoLoadDocProperties, rvfoSaveDocObjects, rvfoLoadDocObjects];

  ADoc.RTFOptions := [rvrtfSaveEMFAsWMF, rvrtfDuplicateUnicode, rvrtfSaveJpegAsJpeg, rvrtfSaveDocParameters,
    rvrtfSaveHeaderFooter];

Re: RTF import/export and trrh / absolute table row height

Posted: Fri Jan 08, 2021 4:00 pm
by Sergey Tkachenko
TRichView does not support this property on per-row basis.
This option can only be set for the whole table (rvtoIgnoreContentHeight in table.Options) and cannot be imported from RTF.