> 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,
- Microsoft Visual Basic MVP -