## making a preview of my richedit

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

### making a preview of my richedit

Hello,

I am having problens to understand the right way to make this:

I have a form with a rxrichedit, I would like to make a print preview from my text, but I took a look at the examples and I understood some parts, could you help me ?

What is the easiest way to preview the text?
How can I work with rxRichedit and not richedit?

Help me with a simple example

Thanks very much
alexhaifa
Junior Member

Posts: 35
Joined: November 22nd, 2005, 2:01 pm
Location: Brazil

The following code is the easiest way to print/preview a rich text.

Code: Select all
with PrintPreview dobegin  BeginDoc;  PaintRichText(PageBounds, RichEdit1, 0, nil);  EndDoc;end;

The rxRichEdit control is much better than Delphi's RichEdit control. Just consider that you have to type cast rxRichEdit to TCustomRichEdit when passing to PaintRichText method.

Code: Select all
with PrintPreview dobegin  BeginDoc;  PaintRichText(PageBounds, TCustomRichEdit(rxRichEdit1), 0, nil);  EndDoc;end;
Kambiz

Kambiz

Posts: 2428
Joined: March 7th, 2003, 7:10 pm

Thanks very very much for your help.

Yeah, you are right regarding to rxrichedit, it is better than richedit and hence I am using it.
alexhaifa
Junior Member

Posts: 35
Joined: November 22nd, 2005, 2:01 pm
Location: Brazil

Kambiz,

I could notice that my rxrichedit has many lines and when I ran your code, I could notice that it compress all the lines in one preview page, how could I split it into pages and thumbnailpreview.

I tried to find a help how to work with print preview but I didn't find any.
I imagine that there isn't any
alexhaifa
Junior Member

Posts: 35
Joined: November 22nd, 2005, 2:01 pm
Location: Brazil

The PaintRichText method automatically splits rich text in several pages as needed. I guess the font size of your text is too small for printer's resolution, or it is a raster font.
Kambiz

Kambiz