|Type||Topic||Plugin||Version||macOS||Windows||Linux||Console & Web||iOS|
|class||Printing||MBS Win Plugin||6.1||No||Yes||No||Yes, Windows only||No|
// Print Postscript directly to Postscript printer
const PrinterName = "Brother DCP-8085DN"
dim w as new WindowsAddPrintJobMBS
if not w.OpenPrinter(PrinterName) then
MsgBox "OpenPrinter failed. Is the printer name correct in the source code?"
const DocName = "My Document"
if not w.StartDocPrinter("My Document", w.kDataFormatRAW) then
MsgBox "StartDocPrinter failed."
MsgBox "Print Job ID: "+str(w.JobID)
dim PostScript as string = "%!PS"+EndOfLine.UNIX+".1 setgray"+EndOfLine.UNIX+"0 0 100 100 rectfill"+EndOfLine.UNIX+"showpage"+EndOfLine.UNIX
dim BytesSent as Integer = w.WritePrinter(PostScript)
MsgBox str(BytesSent)+" bytes of "+str(lenb(PostScript))+" bytes sent."
w = nil // close printer
Perfect for printing postscript data to a postscript printer.
You can use this class in several ways:
1. OpenPrinter, AddJob, WriteJob and ScheduleJob.
2. OpenPrinter, StartDocPrinter, StartPagePrinter, WritePrinter, EndPagePrinter, EndDocPrinter and ClosePrinter.
3. OpenPrinter, StartDocPrinter, WritePrinter, EndDocPrinter and ClosePrinter.
- 5 properties
- 12 methods
- method AddJob as boolean
- method ClosePrinter
- method EndDocPrinter as boolean
- method EndPagePrinter as boolean
- method OpenPrinter(PrinterName as string) as boolean
- method ScheduleJob as boolean
- method StartDocPrinter(DocName as string, Datatype as string) as boolean
- method StartDocPrinter(DocName as string, OutputFile as folderitem, Datatype as string) as boolean
- method StartDocPrinter(DocName as string, OutputFilePath as string, Datatype as string) as boolean
- method StartPagePrinter as boolean
- method WriteJob(data as string) as Integer
- method WritePrinter(data as string) as Integer
- 2 constants
This class has no sub classes.
Some examples which use this class:
The items on this page are in the following plugins: MBS Win Plugin.
MBS Xojo Plugins