Rich Edit Control Printing Problem (like the print preview problem)

Rich Edit Control Printing Problem (like the print preview problem)

Post by Brian Mowat » Wed, 01 Sep 1999 04:00:00



Hi,
I've been using the Windows Rich Edit Control to add RTF to some software.
Problem is that when  I print out, what happens is that the text on the
right
can be 'clipped'. I know there is a known problem with print preview with
the RichEdit (problem has been around for a while but 'mysteriously' wasnt
fixed
for windows 98) - and this is like a less dramatic version of the same
problem.
Basically I use the same RichEdit to draw to different areas of the same
page,
by repeatedly loading it with data then FormatRange - ing it to the screen /
printer.

I can't see how its a 'clip rect' thats doing if - what I mean is say I have
a control
containing:
abcdefghijk
abcdefg
abc
.. *every* line (not just the longest one) can be 'unfinished' - bits or
even full
letters can be missing.

Its strange cos sometimes it prints fine, then a subtle change somewhere
can cause the problem to appear just in certain places.
Any suggestions? I've searched the newsgroups for a solution and I couldn't
see it - although the search gave the impression the RichEdit is .. erm ..
not quite as bulletproof and robust as it could be..:)
(I've printed from Windows95 and Windows98 to an HP4000TN, the rich edit is
wrapped using an MFC CRichEditCtrl, compiled using MSVC++ 6)
Thanks in advance,
Brian.

 
 
 

1. Print Preview Bug with Rich Edit Control

Rendering the contents of a rich edit control to a print preview window
leads to poor results - obviously the character sizes are rounded to
integers and thus the placement of the characters in the window is no
way WYSIWYG. Microsoft has declared this a known bug but offers no
solution in the Knowledge Base.

You can work around this with regular edit controls by drawing each
single character manually into the preview window. This is surprisingly
fast if you cache the character widths before painting the window.

However, this is not possible with rich edit contols as each character
might use a different font or height. But obviously it CAN be done as
the print preview of WordPad (Write) is very precise.

If anybody has implemented an acceptable print preview for rtf edit

how to proceed would suffice, but a few lines of sample code are of
course always welcome.

Any help is greatly appreciated.


2. where are the error logs?

3. Printing / Print Preview problems

4. Sun Stuff FS

5. Print and print preview problem (ASSERT error when allocating GDI font resource in OnBeginPrinting)

6. my experience with MacWarehouse $299 double speed CDRom

7. Print preview of Rich text box contents

8. WTB: Acorn Atom

9. Print Preview Problems.

10. Print preview problem

11. Automated RTF printing & non-editable print preview

12. Printing and Print Preview discrepency

13. OWL2 Print Preview/AppExpert problem