PHP Класс Mike42\Escpos\PrintConnectors\WindowsPrintConnector

Copyright (c) 2014-2015 Michael Billington , incorporating modifications by: - Roni Saha - Gergely Radics - Warren Doyle Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Connector for sending print jobs to - local ports on windows (COM1, LPT1, etc) - shared (SMB) printers from any platform (\\server\foo) For USB printers or other ports, the trick is to share the printer with a generic text driver, then access it locally.
Наследование: implements Mike42\Escpos\PrintConnectors\PrintConnector
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( string $dest )
__destruct ( )
finalize ( )
read ( $len ) * (non-PHPdoc)
write ( $data )

Защищенные методы

Метод Описание
finalizeLinux ( string $data ) Send job to printer -- platform-specific Linux code.
finalizeMac ( string $data ) Send job to printer -- platform-specific Mac code.
finalizeWin ( string $data ) Send data to printer -- platform-specific Windows code.
getCurrentPlatform ( ) : string
runCommand ( string $command, string &$outputStr, string &$errorStr, string $inputStr = null ) : number Run a command, pass it data, and retrieve its return value, standard output, and standard error.
runCopy ( string $from, string $to ) : boolean Copy a file. Separated out so that nothing is actually printed during test runs.
runWrite ( string $data, string $to ) : boolean Write data to a file. Separated out so that nothing is actually printed during test runs.

Описание методов

__construct() публичный Метод

public __construct ( string $dest )
$dest string

__destruct() публичный Метод

public __destruct ( )

finalize() публичный Метод

public finalize ( )

finalizeLinux() защищенный Метод

Send job to printer -- platform-specific Linux code.
protected finalizeLinux ( string $data )
$data string Print data

finalizeMac() защищенный Метод

Send job to printer -- platform-specific Mac code.
protected finalizeMac ( string $data )
$data string Print data

finalizeWin() защищенный Метод

Send data to printer -- platform-specific Windows code.
protected finalizeWin ( string $data )
$data string

getCurrentPlatform() защищенный Метод

protected getCurrentPlatform ( ) : string
Результат string Current platform. Separated out for testing purposes.

read() публичный Метод

* (non-PHPdoc)
См. также: PrintConnector::read()
public read ( $len )

runCommand() защищенный Метод

Run a command, pass it data, and retrieve its return value, standard output, and standard error.
protected runCommand ( string $command, string &$outputStr, string &$errorStr, string $inputStr = null ) : number
$command string the command to run.
$outputStr string variable to fill with standard output.
$errorStr string variable to fill with standard error.
$inputStr string text to pass to the command's standard input (optional).
Результат number

runCopy() защищенный Метод

Copy a file. Separated out so that nothing is actually printed during test runs.
protected runCopy ( string $from, string $to ) : boolean
$from string Source file
$to string Destination file
Результат boolean True if copy was successful, false otherwise

runWrite() защищенный Метод

Write data to a file. Separated out so that nothing is actually printed during test runs.
protected runWrite ( string $data, string $to ) : boolean
$data string Data to print
$to string Destination file
Результат boolean True if write was successful, false otherwise

write() публичный Метод

public write ( $data )