ReportBuilder asks the Windows API for the number of colors a printer is capable of printing. If this number is 2, then it is assumed that it is a black and white only printer and all colors other than white are turned to black so they show up on paper. Are you sure your printer is capable of printing in greyscale? Could ther perhaps be an option on the printer or printer driver to enable this?
-When using RB designer, text set to color gray appear in black on the printer. -When using RB designer, shapes in the same color gray appear in gray on the printer. -When using Word text, set to color gray appear in gray on the printer. -Pasting and printing a PrintScreen in MSPaint from the print preview window in our application gives a correct result. The gray text appears gray as it should be.When printing the same print preview from our application the gray text appear black.
So it don't think its PrinterDriver related, it's RB related.
Which version of ReportBuilder are you using? When you have this printer set to the default, are you able to see this behavior on screen? Let me know the exact model you are printing to so I can download the driver and try to recreate the behavior on my machine.
The code below in TppCustomPrinter.DeviceContextChanged in unit ppPrintr causes all non BW colors to be replaced by the color black.
{for NT try to determine color capabilities for graycale} if (Win32Platform = VER_PLATFORM_WIN32_NT) and (GetDeviceCaps(FDC, SIZEPALETTE) = 2) and (GetDeviceCaps(FDC, NUMCOLORS) = 2) then
Thanks, I will install the printer driver and make a few tests. Note that the GetDeviceCaps routine accesses the Windows API directly. If this printer is capable of printing in more than two colors, the FCanGrayScale should not be getting set to False as the SIZEPALETTE and NUMCOLORS should be greater than 2. These are values we are retrieving from Windows which is retrieving them from the printer driver.
After some further research we found that over the years, the printer drivers have been getting more advanced and capable of handling shades of grey with black and white only printers. The code you mention below has been in ReportBuilder for quite some time as I believe we had issues with B&W printers in the past. Try commenting out this code for the time being so that the FCanGrayScale property is always true. We will update this class for the next release of ReportBuilder.
Comments
ReportBuilder asks the Windows API for the number of colors a printer is
capable of printing. If this number is 2, then it is assumed that it is a
black and white only printer and all colors other than white are turned to
black so they show up on paper. Are you sure your printer is capable of
printing in greyscale? Could ther perhaps be an option on the printer or
printer driver to enable this?
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
-When using RB designer, text set to color gray appear in black on the
printer.
-When using RB designer, shapes in the same color gray appear in gray on the
printer.
-When using Word text, set to color gray appear in gray on the printer.
-Pasting and printing a PrintScreen in MSPaint from the print preview window
in our application gives a correct result. The gray text appears gray as it
should be.When printing the same print preview from our application the gray
text appear black.
So it don't think its PrinterDriver related, it's RB related.
Greetings,
Filip Moons
Which version of ReportBuilder are you using? When you have this printer
set to the default, are you able to see this behavior on screen? Let me
know the exact model you are printing to so I can download the driver and
try to recreate the behavior on my machine.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Printer: HP LaserJet 4050T,
Environment: Win2000 Delphi 5 & RB 7.
The code below in TppCustomPrinter.DeviceContextChanged in unit ppPrintr
causes all non BW colors to be replaced by the color black.
{for NT try to determine color capabilities for graycale}
if (Win32Platform = VER_PLATFORM_WIN32_NT) and
(GetDeviceCaps(FDC, SIZEPALETTE) = 2) and
(GetDeviceCaps(FDC, NUMCOLORS) = 2) then
FCanGrayScale := False;
Greetings,
Filip Moons
Thanks, I will install the printer driver and make a few tests. Note that
the GetDeviceCaps routine accesses the Windows API directly. If this
printer is capable of printing in more than two colors, the FCanGrayScale
should not be getting set to False as the SIZEPALETTE and NUMCOLORS should
be greater than 2. These are values we are retrieving from Windows which is
retrieving them from the printer driver.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
After some further research we found that over the years, the printer
drivers have been getting more advanced and capable of handling shades of
grey with black and white only printers. The code you mention below has
been in ReportBuilder for quite some time as I believe we had issues with
B&W printers in the past. Try commenting out this code for the time being
so that the FCanGrayScale property is always true. We will update this
class for the next release of ReportBuilder.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com