Printing PCL text on grey background

Printing PCL text on grey background

Post by Tomasz Kurowsk » Wed, 11 Jun 2003 16:48:05



During print using Printer object after setting PaperBin
property following error occurs:

Text printed in black on gray rectangle is printed with
extra white background. In other words, text is placed in
white rectangle placed on gray background.
The error does not occur when the paper bin is not changed.
It happens for various PCL drivers.

Please help.

 
 
 

Printing PCL text on grey background

Post by Mike D Sutto » Wed, 11 Jun 2003 17:21:14


Quote:> During print using Printer object after setting PaperBin
> property following error occurs:

> Text printed in black on gray rectangle is printed with
> extra white background. In other words, text is placed in
> white rectangle placed on gray background.
> The error does not occur when the paper bin is not changed.
> It happens for various PCL drivers.

I don't know why the PaperBin property would be affecting this (Maybe
something driver specific?), but you could try forcing the issue by using
the API to specify that no background be drawn:

'***
Private Declare Function SetBkMode Lib "gdi32" Alias "SetBkMode" _
    (ByVal hDC As Long, ByVal nBkMode As Long) As Long
Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" _
    (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, _
    ByVal lpString As String, ByVal nCount As Long) As Long

Private Const TRANSPARENT = 1

' ...

Dim OldMode As Long

Const PrintString = "Hello, world!"

OldMode = SetBkMode(Printer1.hDC(), TRANSPARENT)
Call TextOut(Printer1.hDC(), 10, 20, PrintString, Len(PrintString))
Call SetBkMode(Printer1.hDC(), OldMode)
'***

Hope this helps,

    Mike

 - Microsoft Visual Basic MVP -

WWW: Http://www.mvps.org/EDais/