Board index » delphi » Getting a black page printed when calling print from a TRichEdit

Getting a black page printed when calling print from a TRichEdit

Quote
Cayne wrote:
> Hi,

> Is this a common problem?  All I am doing is calling RichEdit1.Print('');
> It seems to happen more often on some computer than others, and a couple of
> computers havn't done it at all.
> I use the CS version of Delphi 4 with SP3.

> Thanks,

> Cayne.

We have exactly the same problem like yours.  Sometimes it came out two blank
pages.  It also happens on some of the nice RichEdit 2.0 derivatives such as
RxRichEdit.  It seems that it does not matter how much content the RichEdit has
in it.  Any Borland guru has an answer to this problem?  Or it is actually
inherited from Microsoft RichText Box.  Thanks.

James.

 

Re:Getting a black page printed when calling print from a TRichEdit


Well, I do not know if I qualify as a Rich Edit guru, but I will offer
the following.

I have never seen "black" pages result from any sane implementation of
RE, including TRichEdit.  I *have* seen blank pages, however.  I that is
the problem, I know of two common sources for blank pages:

(1) Code that aborts while the RE is printing.  You will probably get
one blank page if you abort printing while the text is being written to
the print spooler.

(2) Code that incorrectly implements Rich Edit 2.0 (or 3.0).  Most
incorrect implementations result in a never-ending stream of form-feeds
(not exactly two blank pages).  The error is usually attributable to
using a deprecated message (with respect to RE 2+) to get the size of
the text in the control.  If this sounds like a possibility, see
http://home.att.net/~robertdunn/Yacs.html and look for the FAQ titled "I
combined the printing code from the "Printing and Previewing Rich Edit
Controls" paper with the TRichEdit20 class.  When I try to print, the
program hangs in the rendering loop.  Any ideas?"  (Warning: The site
has Borland C++ Builder code, not Delphi.  OTOH, most of the solutions
on the site deal with WinAPI work-arounds for the Delphi Pascal VCL code
that is common to Delphi and BCB.)

HTH.

robert

Quote
"James M. Lucas" wrote:

> Cayne wrote:

> > Hi,

> > Is this a common problem?  All I am doing is calling RichEdit1.Print('');
> > It seems to happen more often on some computer than others, and a couple of
> > computers havn't done it at all.
> > I use the CS version of Delphi 4 with SP3.

> > Thanks,

> > Cayne.

> We have exactly the same problem like yours.  Sometimes it came out two blank
> pages.  It also happens on some of the nice RichEdit 2.0 derivatives such as
> RxRichEdit.  It seems that it does not matter how much content the RichEdit has
> in it.  Any Borland guru has an answer to this problem?  Or it is actually
> inherited from Microsoft RichText Box.  Thanks.

> James.

Re:Getting a black page printed when calling print from a TRichEdit


Hi,

Is this a common problem?  All I am doing is calling RichEdit1.Print('');
It seems to happen more often on some computer than others, and a couple of
computers havn't done it at all.
I use the CS version of Delphi 4 with SP3.

Thanks,

Cayne.

Other Threads