Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
CUPS.PrintDataEncoding
Print a file to a printer or class on the default server.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| CUPS | 6.3 | Yes | No | No | Yes, macOS only | No |
Parameters
| Parameter | Description | Example | Flags |
|---|---|---|---|
| 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, ISO-8859-1, Latin1, Mac, Native, UTF-8, DOS, Hex, Base64 or Windows. More listed in the FAQ. |
"UTF-8" | |
| Title | The title of the print job. | "FileMaker Printout" | Optional |
| Options | List of options. Simply add key and values as string parameters to the function call. | "key1"; "value1"; "key2"; "value2" | Optional |
Result
Returns OK or error.
Description
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.
Examples
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
Blog Entries
Created 20th June 2016, last changed 20th June 2016
CUPS.PrintData - CUPS.PrintFile
Feedback: Report problem or ask question.
Links
MBS Xojo PDF Plugins