gdinko/pdfmatrix-sdk
Composer 安装命令:
composer require gdinko/pdfmatrix-sdk
包简介
pdfMatrix Laravel SDK
README 文档
README
pdfmatrix.com JSON API Documentation
Installation
You can install the package via composer:
composer require gdinko/pdfmatrix-sdk
If you need to export configuration file:
php artisan vendor:publish --tag=pdfmatrix-config
Configuration
Add this to .env file:
PDFMATRIX_API_TOKEN= #Get API token from pdfmatrix.com
Usage
use Gdinko\PdfMatrix\Facades\PdfMatrix; $me = PdfMatrix::me(); dd($me);
Methods
use Gdinko\PdfMatrix\Facades\PdfMatrix; //Account information PdfMatrix::me(): array //PDF Generation PdfMatrix::pdf(PdfRequestInterface $request) //PDF Storage PdfMatrix::listMyFiles(): array PdfMatrix::getFile($hash): string PdfMatrix::deleteFile($id): array
Examples
Get information about pdfmatrix API usage
$me = PdfMatrix::me(); dd($me);
List my files stored on pdfmatrix.com cloud
$response = PdfMatrix::listMyFiles(); dd($response);
Generate pdf from url and get JSON response from pdfmatrix.com
use Gdinko\PdfMatrix\Facades\PdfMatrix; use Gdinko\PdfMatrix\Requests\PdfRequest; use Gdinko\PdfMatrix\Exceptions\PdfMatrixException; use Gdinko\PdfMatrix\Exceptions\PdfMatrixValidationException; try { $jsonResponse = PdfMatrix::pdf( new PdfRequest([ 'url' => 'https://pdfmatrix.com', ]) ); dd($jsonResponse); } catch (PdfMatrixException $e) { echo $e->getCode() . '<br />'; echo $e->getMessage() . '<br />'; print_r($e->getErrors()); } catch (PdfMatrixValidationException $ve) { echo $ve->getCode() . '<br />'; echo $ve->getMessage() . '<br />'; print_r($ve->getErrors()); }
Generate pdf from url and send it for download to the browser
use Gdinko\PdfMatrix\Facades\PdfMatrix; use Gdinko\PdfMatrix\Requests\PdfRequest; use Gdinko\PdfMatrix\Exceptions\PdfMatrixException; use Gdinko\PdfMatrix\Exceptions\PdfMatrixValidationException; try { return PdfMatrix::pdf( new PdfRequest([ 'url' => 'https://pdfmatrix.com', 'return' => 'download' ]) ); } catch (PdfMatrixException $e) { echo $e->getCode() . '<br />'; echo $e->getMessage() . '<br />'; print_r($e->getErrors()); } catch (PdfMatrixValidationException $ve) { echo $ve->getCode() . '<br />'; echo $ve->getMessage() . '<br />'; print_r($ve->getErrors()); }
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email dinko359@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
gdinko/pdfmatrix-sdk 适用场景与选型建议
gdinko/pdfmatrix-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6.37k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2022 年 10 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「gdinko」 「pdfmatrix」 「pdfmatrix laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 gdinko/pdfmatrix-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 gdinko/pdfmatrix-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 gdinko/pdfmatrix-sdk 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
统计信息
- 总下载量: 6.37k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-10-03