Hi,
I'm currently using the TRichView Wrapper with Report Builder. Before, my company was using a componant (TrxCustomRichEdit) that can use LineSpacing instead of the standard RichText of Report Builder.
My problem is that TrxCustomRichEdit was able to set LineSpacing before the paragraph in Percent. The only way that I have found to do the same thing in TRichView is the property SpaceBefore. The fact is that it can only be use in pixel of screen but I need it in Percent.
Do you know a way to solve my problem?
Michel
First Line Spacing in a paragraph!
Dots per inch (DPI)
Also, I would like to know if there is a way to use Dots per inch (DPI) instead of Pixel to set the LineSpacing.
Michel
Michel
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
There are 3 vertical spacing properties for the paragraph:
SpaceBefore - spacing before the paragraph,
SpaceAfter - spacing after the paragraph,
LineSpacing - spacing between lines of the paragraph, added AFTER each line.
None of known word processors can define SpaceBefore or SpaceAfter in Percent.
As far as I can see from RX code, RXRichEdit defines them in points (1/72 of inch), not in Percent.
Only LineSpacing can be defined in Percent. But it is defined in Percent by default in TRichViewEdit too (see LineSpacing property), so there is no problem here.
As for defining sizes in absolute values instead of pixels, it is not possible directly, but you can set up a conversion independent from the screen resolution.
Assign RichViewPixelsPerInch=96, and you will be able to convert using the following functions:
SpaceBefore - spacing before the paragraph,
SpaceAfter - spacing after the paragraph,
LineSpacing - spacing between lines of the paragraph, added AFTER each line.
None of known word processors can define SpaceBefore or SpaceAfter in Percent.
As far as I can see from RX code, RXRichEdit defines them in points (1/72 of inch), not in Percent.
Only LineSpacing can be defined in Percent. But it is defined in Percent by default in TRichViewEdit too (see LineSpacing property), so there is no problem here.
As for defining sizes in absolute values instead of pixels, it is not possible directly, but you can set up a conversion independent from the screen resolution.
Assign RichViewPixelsPerInch=96, and you will be able to convert using the following functions:
Code: Select all
function InchesToPixels(Value: Extended): Integer;
begin
Result := Round(Value * 96);
end;
function PixelsToInches(Value: Integer): Extended;
begin
Result := Value / 96;
end;
That was quick!
Thank you for the quick answer, I'll try to solve my problem with the tools you have provided me!
Michel
Michel
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Please send me this RTF file to svt@trichview.com
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Hi,
I do not have application with RxRichEdit, but I tried WordPad instead. Both of them are based on richedit control (as far as I understand, standard TRichEdit is based on version 1 of richedit, TRxRichEdit is based on version 2 of richedit, WordPad is based on newer version of RichEdit).
In your file, line spacing is 95% (lines are condensed).
When I print from WordPad and from TRichView, document from WordPad has more height than from TRichView. But when I set LineSpacing=100% in TRichView, the results are exactly like in WordPad.
So WordPad (and I believe RxRichEdit too) ignores condensed line spacing.
I do not have application with RxRichEdit, but I tried WordPad instead. Both of them are based on richedit control (as far as I understand, standard TRichEdit is based on version 1 of richedit, TRxRichEdit is based on version 2 of richedit, WordPad is based on newer version of RichEdit).
In your file, line spacing is 95% (lines are condensed).
When I print from WordPad and from TRichView, document from WordPad has more height than from TRichView. But when I set LineSpacing=100% in TRichView, the results are exactly like in WordPad.
So WordPad (and I believe RxRichEdit too) ignores condensed line spacing.