printermonk/printermonk-php
Composer 安装命令:
composer require printermonk/printermonk-php
包简介
A PHP Client for PrinterMonk to give your printer an API
关键字:
README 文档
README
This is an open source PHP client for the PrinterMonk API
Installation
Get it with composer
composer require printermonk/printermonk-php
Example: get all printers
<?php use PrinterMonk\PrinterMonkClient; use PrinterMonk\Repositories\PrinterRepository; require __DIR__ . '/vendor/autoload.php'; $apiKey = getenv('PRINTERMONK_API_KEY'); // Your PrinterMonk API key $client = new PrinterMonkClient($apiKey); $printers = PrinterRepository::all($client); var_dump($printers);
Example: get a single printer
<?php use PrinterMonk\PrinterMonkClient; use PrinterMonk\Repositories\PrinterRepository; require __DIR__ . '/vendor/autoload.php'; $apiKey = getenv('PRINTERMONK_API_KEY'); // Your PrinterMonk API key $printerId = 'prtr_uniqueprinterkey'; $client = new PrinterMonkClient($apiKey); $printer = PrinterRepository::find($printerId, $client); var_dump($printer);
Example: send a new print job to PrinterMonk
<?php use PrinterMonk\Entities\PrintJob; use PrinterMonk\PrinterMonkClient; require __DIR__ . '/vendor/autoload.php'; $apiKey = getenv('PRINTERMONK_API_KEY'); // Your PrinterMonk API key $printerId = 'prtr_uniqueprinterkey'; $client = new PrinterMonkClient($apiKey); $printJob = new PrintJob(); $printJob->printerId = $printerId; $printJob->name = 'Example document'; $printJob->contentType = 'pdf'; $printJob->content = base64_encode(file_get_contents('example.pdf')); $printJob->post($client);
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-02-07