MBS Xojo Developer Conference and Training
Join us from 3rd to 6th May 2017 in Berlin, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

WindowsAddPrintJobMBS class

class, Printing, MBS Win Plugin (WindowsPrint), class WindowsAddPrintJobMBS,
Plugin version: 6.1, Mac: No, Win: Yes, Linux: No, Console & Web: Yes, Feedback.

Function: A class to send raw data to a printer.
Example:
// 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?"
Return
end if

const DocName = "My Document"

if not w.StartDocPrinter("My Document", w.kDataFormatRAW) then
MsgBox "StartDocPrinter failed."
Return
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
Notes:
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.

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




Links
MBS Xojo Chart Plugins