Setting color to TppLine object setting does not print on printer that doesn't support GrayScale
Hi,
The method TppPrinterCanvas.UpdateDeviceContext in unit ppPrintr is
defined as:
procedure TppPrinterCanvas.UpdateDeviceContext;
var
lFontSize: Integer;
begin
if (FPrinter = nil) then Exit;
if (FPrinter.PixelsPerInch.Y <> Font.PixelsPerInch) then
begin
lFontSize := Font.Size;
Font.PixelsPerInch := FPrinter.PixelsPerInch.Y;
Font.Size := lFontSize;
end;
if not (FPrinter.CanGrayScale) then
begin
if (Font.Color <> clBlack) and (Font.Color <> clWhite) then
Font.Color := clBlack;
end;
end; {procedure, UpdateDeviceContext}
If a printer doesn't not support gray scale, the font color should reset
to clBlack. This is fine for most case. However, a Canvas object has
Pen and Brush property. The Pen or Brush may used by TppShape or
TppLine. If Pen or Brush color was set to non Black, it won't print on
printer that doesn't support GrayScale.
I suggest ReportBuilder add the following to make Pen and Brush works on
non GrayScale printer:
if (Pen.Color <> clBlack) and (Pen.Color <> clWhite) then
Pen.Color := clBlack;
if (Brush.Color <> clBlack) and (Brush.Color <> clWhite) then
Brush.Color := clBlack;
--
Best regards,
Chau Chee Yang
The method TppPrinterCanvas.UpdateDeviceContext in unit ppPrintr is
defined as:
procedure TppPrinterCanvas.UpdateDeviceContext;
var
lFontSize: Integer;
begin
if (FPrinter = nil) then Exit;
if (FPrinter.PixelsPerInch.Y <> Font.PixelsPerInch) then
begin
lFontSize := Font.Size;
Font.PixelsPerInch := FPrinter.PixelsPerInch.Y;
Font.Size := lFontSize;
end;
if not (FPrinter.CanGrayScale) then
begin
if (Font.Color <> clBlack) and (Font.Color <> clWhite) then
Font.Color := clBlack;
end;
end; {procedure, UpdateDeviceContext}
If a printer doesn't not support gray scale, the font color should reset
to clBlack. This is fine for most case. However, a Canvas object has
Pen and Brush property. The Pen or Brush may used by TppShape or
TppLine. If Pen or Brush color was set to non Black, it won't print on
printer that doesn't support GrayScale.
I suggest ReportBuilder add the following to make Pen and Brush works on
non GrayScale printer:
if (Pen.Color <> clBlack) and (Pen.Color <> clWhite) then
Pen.Color := clBlack;
if (Brush.Color <> clBlack) and (Brush.Color <> clWhite) then
Brush.Color := clBlack;
--
Best regards,
Chau Chee Yang
This discussion has been closed.
Comments
Thanks for the feedback, will add this for the next maintenance release.
Best regards,
-
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com