Click to See Complete Forum and Search --> : Some API functions for printer


yfellow
September 25th, 2001, 09:39 AM
Hi,
Some printers that I could set the pagesize to User-defined and set the printer.width and printer.height. But some printer does not let me to do these kinds of settings. I did some research about it, and it said that it has to do with the printer's driver.
I am wondering if any API functions that I can set the page size to 5' x 3'?
Your answer will be valuable to me.

Thank you very much!

Cimperiali
September 25th, 2001, 10:09 AM
Const DC_PAPERS = 2
private Declare Function DeviceCapabilities Lib "winspool.drv" Alias "DeviceCapabilitiesA" (byval lpDeviceName as string, byval lpPort as string, byval iIndex as Long, lpOutput as Any, lpDevMode as Any) as Long
private Sub Form_Load()
'KPD-Team 1999
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
Dim Ret as Long, PaperSizes() as Integer
Ret = DeviceCapabilities(Printer.DeviceName, "LPT1", DC_PAPERS, byval 0&, byval 0&)
ReDim PaperSizes(1 to Ret) as Integer
Call DeviceCapabilities(Printer.DeviceName, "LPT1", DC_PAPERS, PaperSizes(1), byval 0&)
me.AutoRedraw = true
me.print "Supported papersizes:"
Dim Cnt as Long
for Cnt = 1 to Ret
me.print Str$(PaperSizes(Cnt))
next
End Sub





Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.

The Rater