Page 1 of 1
Posted: Wed Feb 19, 2003 2:26 pm
by BackupUser
Restored from previous forum. Originally posted by gnozal.
I'd like more printer functions :
Some ideas :
1. Start to print _without_ a PrinterRequester waiting for an user input.
If PrintBegin(PrinterName$) ; if PrinterName$ = "" then default printer
... printing stuff
EndIf
2. Get the name of windows default printer
PrinterName$ = GetDefaultPrinter()
3. And of all defined printers
If ExaminePrinters()
While NextPrinter()
PrinterName$ = GetPrinterName()
Wend
EndIf
Posted: Thu Feb 20, 2003 8:44 am
by BackupUser
Restored from previous forum. Originally posted by fred.
Ok, thanks for your suggestions !
Fred - AlphaSND
Posted: Fri Jul 11, 2003 9:05 pm
by schamu
I´d like to have a function to set the printer to the landscape mode.
Posted: Sat Oct 18, 2003 8:38 pm
by Bernard
It's very difficult to set the printer orientation.
I´d like to have a function to set it.
Many thanks
Posted: Sat Oct 18, 2003 9:30 pm
by blueb
Try this:
Code: Select all
; ------------------------------------------------
; Print sideways (Landscape mode)
; Author unknown (Kanati??) - from the German forum
; ------------------------------------------------
;What to print
Printoutt.s = "Kanati is a nice guy and such a pleasure to talk to."
x.l = Len(Printoutt)
;Standard printer information
STDPrinterName$ = Space(260)
GetPrivateProfileString_("WINDOWS","DEVICE","", @STDPrintername$, 260, "Win.Ini")
STDPrintername$ = StringField(STDPrintername$, 1,",")
PrinterHandle.l = 0
OpenPrinter_(StdPrintername$,@PrinterHandle.l,0)
;MessageRequester("",Str(PrinterHandle),0)
Dim DevIn.DEVMODE(0)
Dim DevOut.DEVMODE(0)
DocumentProperties_(0,Printerhandle,StdPrintername$,DevIn(0),DevOut(0),#DM_OUT_BUFFER|#DM_IN_BUFFER)
ClosePrinter_(PrinterHandle)
If DevIn(0)\dmOrientation = 1
MessageRequester("Printer Orientation","Landscape Mode",0)
ElseIf DevIn(0)\dmOrientation = 2
MessageRequester("Printer Orientation","Portrait Mode",0)
EndIf
DevIn(0)\dmOrientation = 2; Set to Landscape mode and print results
PrinterDC.l = CreateDC_("WINSPOOL",StdPrintername$,0,DevIn(0))
DocInf.DOCINFO
DocInf\cbSize = SizeOf(DOCINFO)
DocInf\lpszDocName = @"Mein Dok"
DocInf\lpszOutput = #NULL
If StartDoc_(PrinterDC,@DocInf) > 0
If StartPage_(PrinterDC) > 0
TextOut_(PrinterDC,60,70,@Printoutt,x)
EndPage_(PrinterDC)
EndDoc_(PrinterDC)
EndIf
EndIf
Posted: Mon Oct 20, 2003 8:21 am
by Bernard
I Tried this code but I can't use the standards commands like Locate, Drawtext.
I think we can use API GetPrinter and SetPrinter but I don't find some samples on the forum and I don't know enough the API to use them.
If someone have a sample I will be Happy.