Printer
in package
Printer class for Epson Connect PHP.
This class handles the interaction with the Epson Connect API for printing tasks. It includes methods for uploading files, setting print settings, and executing print jobs.
Table of Contents
- $_auth : mixed
- $_valid_extensions : mixed
- $_valid_operators : mixed
- __construct() : mixed
- Constructor for the Printer class.
- capabilities() : array<string|int, mixed>
- Retrieves the capabilities of the printer.
- executePrint() : mixed
- Executes a print job with the specified job ID.
- getDeviceId() : string
- Retrieves the device ID from the Auth instance.
- mergeWithDefaultSettings() : array<string|int, mixed>
- Merges the provided settings with the default settings.
- print() : string
- Prints a file.
- print_setting() : array<string|int, mixed>
- Sends the print settings to the API.
- upload_file() : array<string|int, mixed>
- Uploads a file to the specified URI for printing.
Properties
$_auth
private
mixed
$_auth
$_valid_extensions
private
mixed
$_valid_extensions
= ['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'pdf', 'jpeg', 'jpg', 'bmp', 'gif', 'png', 'tiff']
$_valid_operators
private
mixed
$_valid_operators
= ['user', 'operator']
Methods
__construct()
Constructor for the Printer class.
public
__construct(Auth $auth) : mixed
Parameters
- $auth : Auth
-
An instance of the Auth class for authentication.
Return values
mixed —capabilities()
Retrieves the capabilities of the printer.
public
capabilities(string $mode) : array<string|int, mixed>
Parameters
- $mode : string
-
The mode for which to retrieve capabilities.
Return values
array<string|int, mixed> —The capabilities of the printer.
executePrint()
Executes a print job with the specified job ID.
public
executePrint(string $jobId) : mixed
Parameters
- $jobId : string
-
The ID of the job to print.
Return values
mixed —getDeviceId()
Retrieves the device ID from the Auth instance.
public
getDeviceId() : string
Return values
string —The device ID.
mergeWithDefaultSettings()
Merges the provided settings with the default settings.
public
mergeWithDefaultSettings(array<string|int, mixed> $settings) : array<string|int, mixed>
Parameters
- $settings : array<string|int, mixed>
-
The settings to merge with the defaults.
Return values
array<string|int, mixed> —The merged settings.
print()
Prints a file.
public
print(string $file_path) : string
This method uploads the file, sends the print settings, and executes the print job.
Parameters
- $file_path : string
-
The path of the file to print.
Return values
string —The ID of the print job.
print_setting()
Sends the print settings to the API.
public
print_setting(array<string|int, mixed> $settings) : array<string|int, mixed>
Parameters
- $settings : array<string|int, mixed>
-
The print settings to send.
Return values
array<string|int, mixed> —The response from the API.
upload_file()
Uploads a file to the specified URI for printing.
public
upload_file(string $upload_uri, string $file_path, string $print_mode) : array<string|int, mixed>
Parameters
- $upload_uri : string
-
The URI to which to upload the file.
- $file_path : string
-
The path of the file to upload.
- $print_mode : string
-
The print mode (e.g., 'photo').
Tags
Return values
array<string|int, mixed> —The response from the API.