Page 1 of 1

Only one rtf page in TPrintPreview

PostPosted: October 26th, 2003, 10:12 am
by henk_struijk
A few days ago I dowloaded the Print Preview Suite v4.3. It works very fine (and easy). However, I experience a problem: TPrintPreview always shows only the first page of RichEdit texts.

By debugging the Rich Text Demo I found that this is caused by the function PaintRichText. The parameter Offset is always returned as -1. This means that in the Demo in procedure RenderRichEdit the while loop is only entered once. Hence only one page will be shown.

Is it possible that this problem is caused by a bug in Microsoft's implementation of their RichText common control? If so (or if not), what can I do to get rid of the problem?

PostPosted: October 26th, 2003, 11:17 am
by Kambiz
Well, the RichEdit control has problem in rendering embedded objects and page breaks, however this problem no.

Please in the Rich Text Demo, change the page type to A5. In this case, the sample file should be rendered in two pages.

If the problem is with a specific file, it would be nice to have that file to check it out.

Thanks,
Kambiz

PostPosted: October 27th, 2003, 3:12 pm
by henk_struijk
Hello Kambiz,

Thank you for your very quick answer!

I followed your suggestion, but it didn't help. I have Delphi 6 on Windows 98 and Delphi 7 on Windows NT (on the same PC). On both platforms only one page of an RTF text is shown in the Preview. I used the sample rtf file, but also other rtf files (e.g. overview.rtf which comes with Delphi's RichEdit demo).

This afternoon I installed Delphi 7 on another PC (with Windows XP). The Preview suite as well of course. And guess... everything works fine. I don't understand why... Do you?

Thanks again,

Henk

PostPosted: October 27th, 2003, 11:33 pm
by Kambiz
I don't know too. :?