承接 gdinko/pdfmatrix-sdk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

gdinko/pdfmatrix-sdk

最新稳定版本:v1.0.0

Composer 安装命令:

composer require gdinko/pdfmatrix-sdk

包简介

pdfMatrix Laravel SDK

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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.

统计信息

  • 总下载量: 6.37k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-10-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固