Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Finding printer color capability in TppReport.OnEndPage

edited February 2003 in General
I need to know whether the target printer is color or monochrome & I need
this in an OnEndPage handler.

I've tried this:

if GetDeviceCaps(ppReport.Printer.PrinterHandle, BITSPIXEL) > 1 then

but GetDeviceCaps always returns 0, even though PrinterHandle is non-zero.

Any ideas?

Dave Riley

Comments

  • edited February 2003
    Hi Dave,

    AFAIK, you have to pass a device context handle instead the printer handle.

    HTH,
    Chris Ueberall;
  • edited February 2003
    Thanks Chris,

    Any idea how I convert a printer handle into a DC handle ?

    Or, is there any other way I can get the printer DC handle (which is what
    the Handle property of the Delphi 'Printer' function returns) from the
    ppReport object ?

    Dave.


    On 5 Feb 2003 05:21:57 -0600, Ueberall@NOSPAM.osd.de (Chris Ueberall
  • edited February 2003
    Ah, I've just discovered the DC property of TppCustomPrinter - it all
    works now. Thanks for the pointer.

    Dave.


    On Wed, 5 Feb 2003 21:26 +0000 (GMT Standard Time), adr@cix.co.uk (Dave
This discussion has been closed.