Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5   8.0   8.1    Statistic  


Print a file to a printer or class on the default server.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
CUPS 6.3 Yes No Yes, macOS only No No

MBS( "CUPS.PrintDataEncoding"; Printer; Data; Encoding { ; Title; Options } )


Parameter Description Example value
Printer The name of the printer. "Brother_DCP_8085DN"
Data The file data to print. You can include escapes with backslash. \n gives new line, \r gives return, \\ gives a backslash. \xx with a hex number gives that character. e.g. \41 gives an A. "Hello World\nJust a test!\n"
Encoding The text encoding for data.
Possible encoding names: ANSI, Arabic-Mac, Arabic-Win, Baltic-Win, CentralEurope-Mac, ChineseSimp-Mac, ChineseSimp-Win, ChineseTrad-Mac, ChineseTrad-Win, Cyrillic-Mac, Cyrillic-Win, EasternEurope-Win, Greek-Mac, Greek-Win, Hebrew-Mac, Hebrew-Win, ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5, ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-15, Korean-Johab, Korean-Mac, Korean-Win, Latin1, Mac, Native, ShiftJIS-Mac, ShiftJIS-Win, Turkish-Mac, Turkish-Win, UTF-8, DOS or Windows. Pass native to use the native encoding of the current platform.
Title Optional
The title of the print job.
"FileMaker Printout"
Options Optional
List of options. Simply add key and values as string parameters to the function call.
"key1"; "value1"; "key2"; "value2"


Returns OK or error.


Print a file to a printer or class on the default server.
With \xx you can embed any character in the text.
\t gives a tab, \n a LF, \r a newline.


Sends some data in Windows encoding:

Set Variable [$data; Value:"Hello World.¶Tägliche Grüße!"]
Set Variable [$data; Value:MBS( "Text.ReplaceNewline"; $data; 3 )]
Set Variable [$r; Value:MBS( "Text.WriteTextFile"; $data; "/tmp/test.txt"; "Windows" )]
Set Variable [$r; Value:MBS( "CUPS.PrintDataEncoding"; "Brother_DCP_8085DN"; $data; "Windows"; "Test Print" )]

See also

CUPS.PrintData   -   CUPS.PrintFile

Feedback: Report problem or ask question.

MBS FileMaker Plugins