printermonk/printermonk-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固