ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 TIERichEdit - Margins
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Rea.B

USA
5 Posts

Posted - Nov 21 2025 :  14:04:34  Show Profile  Reply
Is there a way to specify margins? The following works if I use a text editor to insert
\margl1080\margr1080\margt1080\margb1080 after the initial \rtf1 tag.

This would be helpful when opening the rtf file in MS Word as it would help to preserve the formatting.

This component is really nice to use! :-)

Thanks.

Rea B.

xequte

39298 Posts

Posted - Nov 21 2025 :  16:54:58  Show Profile  Reply
Hi Rea

Yes, you can use the Paragraph property, e.g.

// Specify a left-margin for the current paragraph of 1 inch
// const Points_Per_Inch = 72;
IERichEdit1.Paragraph.LeftIndent := 1 * Points_Per_Inch;


https://www.imageen.com/help/TIERichEdit.Paragraph.html

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

Rea.B

USA
5 Posts

Posted - Nov 22 2025 :  03:29:03  Show Profile  Reply
Hi Nigel.

I added a popup menu and a method with the above code, ran the program, selected a paragraph, executed the method and got the margin of choice for all lines except the first one. I also need top and bottom "indents" but could not find them.

Is it possible to add document wide margins to this component in the future?

Thanks for your help, and consideration!

Rea B.
Go to Top of Page

xequte

39298 Posts

Posted - Nov 22 2025 :  20:48:11  Show Profile  Reply
Hi Rea

For that, you also need to set Editor.Paragraph.FirstIndent (which is relative to the Left Indent).

TIERichEdit uses the Windows Rich Edit API, which does not support top and bottom margins, but you can use the similar SpaceBefore and SpaceAfter:

// Add 1/4 inch of space before and after the paragraph
// const Points_Per_Inch = 72;
IERichEdit1.Paragraph.SpaceBefore := Round( 0.25 * Points_Per_Inch );
IERichEdit1.Paragraph.SpaceAfter  := Round( 0.25 * Points_Per_Inch );


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

Rea.B

USA
5 Posts

Posted - Nov 23 2025 :  03:36:00  Show Profile  Reply
Thank you Nigel!


Rea B.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: