About Richtext Printing/Preview

  • Thread starter Thread starter Jason Xu
  • Start date Start date
J

Jason Xu

Hello all.
I have a question regarding Richtext printing/preview.
I know how to print richtext in C# by sending some messages to the
underlying rich edit control. However, I am only able to print on a
pre-defined rectangle area, which is not convenient in many cases. Is
there any way that I only define the width of printing area and get
the actual printing height?

Any hints will be appreciated.

Jason
 
Steve, Thanks for you help. But this is not the answer to my question.
I read that article already. It only tells me how to print richtext in
a rectangle area with pre-defined width and height.
Now my question is, is there any way only to define the width? since the
length of the text is not known yet, I want to print the text first, then
get the actual printing height.
Any thought?

Thanks,

Jason
 
You might want to re-read the article... ;)
The key to achive what you want is to perform a MeasureOnly-printing run,
where nothing is actually printed. That way you get all the callbacks you
should need to calculate the height of the complete text.

Regards,
Martin Müller
 
Hi Martin,

The measureOnly printing will return the the next char# to print.
I still have to specify the rectangle printing area in advance, right?
In that way, I will be able to know if the richtext fits in the rect area.
But I still can't get the actual height of the complete text.
Did I miss something?

Thanks,

Jason
 
Back
Top