Device Context

For questions and postings not covered by the other forums
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Device Context

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:35 pm

by Scott >> Thu, 10 Jun 2004 23:04:28 GMT

Hi all - Is there a way to obtain a device context for a printer in JADE (other than using the CMDPrint dialog)?

Thanks

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Device Context

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:35 pm

by Jade Support >> Fri, 11 Jun 2004 4:17:47 GMT

Unfortunately you cannot access the printer device context directly from JADE logic, calling Windows APIs is the only way. (Note that the CMDPrint dialog returned DC is not the one JADE uses).

The following Windows APIs may be useful...

External Function Definitions:

createDC(
lpszDriver,
lpszDevice : String;
lpszOutput : Integer;
lpInitData : Binary) : Integer is CreateDCA in gdi32;

deleteDC(hdc : Integer) : Integer is DeleteDC in gdi32;


Example:

vars
hdc,
result : Integer;begin

hdc := call createDC('WINSPOOL', app.printer.getPrinterName(), 0, 0);
result := call deleteDC(hdc);
end;


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 31 guests