Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

WindowsAddPrintJobMBS class

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class Printing MBS Win Plugin 6.1 No Yes No Yes, Windows only No
Function: A class to send raw data to a printer.
// 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?"
end if

const DocName = "My Document"

if not w.StartDocPrinter("My Document", w.kDataFormatRAW) then
MsgBox "StartDocPrinter failed."
end if

MsgBox "Print Job ID: "+str(w.JobID)

call w.StartPagePrinter

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."

call w.EndPagePrinter
call w.EndDocPrinter

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.

Feedback, Comments & Corrections

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.

WindowGroupMBS   -   WindowsAudioMixerMBS

MBS Xojo PDF Plugins