Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

WindowsAddPrintJobMBS.AddJob as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Printing MBS Win Plugin 6.1 No Yes No Yes, Windows only No
Function: Creates a new print job.
Notes: Returns true on success and false on failure.

Feedback, Comments & Corrections

WindowsAddPrintJobMBS.ClosePrinter
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Printing MBS Win Plugin 16.4 No Yes No Yes, Windows only No
Function: Closes printer connection.

Feedback, Comments & Corrections

WindowsAddPrintJobMBS.EndDocPrinter as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Printing MBS Win Plugin 10.3 No Yes No Yes, Windows only No
Function: The EndDocPrinter function ends a print job for the specified printer.
Notes:
If the function succeeds, the return value is a true.

The EndDocPrinter function returns an error if the print job was not started by calling the StartDocPrinter function.

The sequence for a print job is as follows:

1. To begin a print job, call StartDocPrinter.
2. To begin each page, call StartPagePrinter.
3. To write data to a page, call WritePrinter.
4. To end each page, call EndPagePrinter.
5. Repeat 2, 3, and 4 for as many pages as necessary.
6. To end the print job, call EndDocPrinter.

When a page in a spooled file exceeds approximately 350 MB, it may fail to print and not send an error message. For example, this can occur when printing large EMF files. The page size limit depends on many factors including the amount of virtual memory available, the amount of memory allocated by calling processes, and the amount of fragmentation in the process heap.

Feedback, Comments & Corrections

WindowsAddPrintJobMBS.EndPagePrinter as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Printing MBS Win Plugin 10.3 No Yes No Yes, Windows only No
Function: The EndPagePrinter function notifies the print spooler that the application is at the end of a page in a print job.
Notes:
If the function succeeds, the return value is a true.

The sequence for a print job is as follows:

1. To begin a print job, call StartDocPrinter.
2. To begin each page, call StartPagePrinter.
3. To write data to a page, call WritePrinter.
4. To end each page, call EndPagePrinter.
5. Repeat 2, 3, and 4 for as many pages as necessary.
6. To end the print job, call EndDocPrinter.

When a page in a spooled file exceeds approximately 350 MB, it can fail to print and not send an error message. For example, this can occur when printing large EMF files. The page size limit depends on many factors including the amount of virtual memory available, the amount of memory allocated by calling processes, and the amount of fragmentation in the process heap.

Feedback, Comments & Corrections

WindowsAddPrintJobMBS.OpenPrinter(PrinterName as string) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Printing MBS Win Plugin 6.1 No Yes No Yes, Windows only No
Function: Opens the printer for printing.
Notes:
Returns true on success and false on failure.
PrinterName can be "" for the default printer.

Feedback, Comments & Corrections

WindowsAddPrintJobMBS.ScheduleJob as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Printing MBS Win Plugin 6.1 No Yes No Yes, Windows only No
Function: Schedules the printing.
Notes: Returns true on success and false on failure.

Feedback, Comments & Corrections

WindowsAddPrintJobMBS.StartDocPrinter(DocName as string, Datatype as string) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Printing MBS Win Plugin 10.3 No Yes No Yes, Windows only No
Function: The StartDocPrinter function notifies the print spooler that a document is to be spooled for printing.
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:
DocName: A string that specifies the name of the document.
OutputFile: Optional a path string or a folderitem that specifies the name of an output file. To print to a printer, set this to "" or nil or leave away.
Datatype: A string that identifies the type of data used to record the document.

If the function succeeds, the return value is true and the JobID property is set.

The sequence for a print job is as follows:

1. To begin a print job, call StartDocPrinter.
2. To begin each page, call StartPagePrinter.
3. To write data to a page, call WritePrinter.
4. To end each page, call EndPagePrinter.
5. Repeat 2, 3, and 4 for as many pages as necessary.
6. To end the print job, call EndDocPrinter.

When a page in a spooled file exceeds approximately 350 MB, it can fail to print and not send an error message. For example, this can occur when printing large EMF files. The page size limit depends on many factors including the amount of virtual memory available, the amount of memory allocated by calling processes, and the amount of fragmentation in the process heap.

See also:

Feedback, Comments & Corrections

WindowsAddPrintJobMBS.StartDocPrinter(DocName as string, OutputFile as folderitem, Datatype as string) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Printing MBS Win Plugin 10.3 No Yes No Yes, Windows only No
Function: The StartDocPrinter function notifies the print spooler that a document is to be spooled for printing.
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"

// output to a file
dim file as FolderItem = SpecialFolder.Desktop.Child("test.ps")

if not w.StartDocPrinter("My Document", file, 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:
DocName: A string that specifies the name of the document.
OutputFile: Optional a path string or a folderitem that specifies the name of an output file. To print to a printer, set this to "" or nil or leave away.
Datatype: A string that identifies the type of data used to record the document.

If the function succeeds, the return value is true and the JobID property is set.

The sequence for a print job is as follows:

1. To begin a print job, call StartDocPrinter.
2. To begin each page, call StartPagePrinter.
3. To write data to a page, call WritePrinter.
4. To end each page, call EndPagePrinter.
5. Repeat 2, 3, and 4 for as many pages as necessary.
6. To end the print job, call EndDocPrinter.

When a page in a spooled file exceeds approximately 350 MB, it can fail to print and not send an error message. For example, this can occur when printing large EMF files. The page size limit depends on many factors including the amount of virtual memory available, the amount of memory allocated by calling processes, and the amount of fragmentation in the process heap.

See also:

Feedback, Comments & Corrections

WindowsAddPrintJobMBS.StartDocPrinter(DocName as string, OutputFilePath as string, Datatype as string) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Printing MBS Win Plugin 10.3 No Yes No Yes, Windows only No
Function: The StartDocPrinter function notifies the print spooler that a document is to be spooled for printing.
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"

// output to a file
dim file as string = "C:\test.ps"

if not w.StartDocPrinter("My Document", file, 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:
DocName: A string that specifies the name of the document.
OutputFile: Optional a path string or a folderitem that specifies the name of an output file. To print to a printer, set this to "" or nil or leave away.
Datatype: A string that identifies the type of data used to record the document.

If the function succeeds, the return value is true and the JobID property is set.

The sequence for a print job is as follows:

1. To begin a print job, call StartDocPrinter.
2. To begin each page, call StartPagePrinter.
3. To write data to a page, call WritePrinter.
4. To end each page, call EndPagePrinter.
5. Repeat 2, 3, and 4 for as many pages as necessary.
6. To end the print job, call EndDocPrinter.

When a page in a spooled file exceeds approximately 350 MB, it can fail to print and not send an error message. For example, this can occur when printing large EMF files. The page size limit depends on many factors including the amount of virtual memory available, the amount of memory allocated by calling processes, and the amount of fragmentation in the process heap.

See also:

Feedback, Comments & Corrections

WindowsAddPrintJobMBS.StartPagePrinter as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Printing MBS Win Plugin 10.3 No Yes No Yes, Windows only No
Function: The StartPagePrinter function notifies the spooler that a page is about to be printed on the specified printer.
Notes:
If the function succeeds, the return value is a true.

The sequence for a print job is as follows:

1. To begin a print job, call StartDocPrinter.
2. To begin each page, call StartPagePrinter.
3. To write data to a page, call WritePrinter.
4. To end each page, call EndPagePrinter.
5. Repeat 2, 3, and 4 for as many pages as necessary.
6. To end the print job, call EndDocPrinter.

When a page in a spooled file exceeds approximately 350 MB, it can fail to print and not send an error message. For example, this can occur when printing large EMF files. The page size limit depends on many factors including the amount of virtual memory available, the amount of memory allocated by calling processes, and the amount of fragmentation in the process heap.

Feedback, Comments & Corrections

WindowsAddPrintJobMBS.WriteJob(data as string) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Printing MBS Win Plugin 6.1 No Yes No Yes, Windows only No
Function: Adds data to the spool file.
Notes:
You need to pass raw data for the printer, e.g. postscript data.
Returns the number of bytes written.
So lenb(data) should be equal to the result.
Only available between a call to AddJob and ScheduleJob.

Feedback, Comments & Corrections

WindowsAddPrintJobMBS.WritePrinter(data as string) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Printing MBS Win Plugin 10.3 No Yes No Yes, Windows only No
Function: The WritePrinter function notifies the print spooler that data should be written to the specified printer.
Notes:
data: The data that should be written to the printer.

If the function succeeds, the return value is a true.

The sequence for a print job is as follows:

1. To begin a print job, call StartDocPrinter.
2. To begin each page, call StartPagePrinter.
3. To write data to a page, call WritePrinter.
4. To end each page, call EndPagePrinter.
5. Repeat 2, 3, and 4 for as many pages as necessary.
6. To end the print job, call EndDocPrinter.

When a high-level document (such as an Adobe PDF or Microsoft Word file) or other printer data (such PCL, PS, or HPGL) is sent directly to a printer, the print settings defined in the document take precedent over Windows print settings.

When a page in a spooled file exceeds approximately 350 MB, it can fail to print and not send an error message. For example, this can occur when printing large EMF files. The page size limit depends on many factors including the amount of virtual memory available, the amount of memory allocated by calling processes, and the amount of fragmentation in the process heap.

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Win Plugin.




Links
MBS FileMaker blog