Skip to content

PHP SDK

查找最新版本

进入网址:https://packagist.org/

搜索: fastposter

安装插件

bash
composer require fastposter/fastposter
composer require fastposter/fastposter

示例代码

php
include_once "vendor/autoload.php";

$client = new Fastposter\Client("166f703676bb42ab");

$params = [
    'name' => '测试文本'
];
$client->buildPoster("2ef32fb23c6d458b", $params)->save('a.png');
include_once "vendor/autoload.php";

$client = new Fastposter\Client("166f703676bb42ab");

$params = [
    'name' => '测试文本'
];
$client->buildPoster("2ef32fb23c6d458b", $params)->save('a.png');
php
include_once "vendor/autoload.php";

$client = new Fastposter\Client("166f703676bb42ab", "http://127.0.0.1:5000");

$params = [
    'name' => '测试文本'
];
$client->buildPoster("80058c79d1e2e617", $params)->save('a.png');
include_once "vendor/autoload.php";

$client = new Fastposter\Client("166f703676bb42ab", "http://127.0.0.1:5000");

$params = [
    'name' => '测试文本'
];
$client->buildPoster("80058c79d1e2e617", $params)->save('a.png');

生成的海报图片

获取图片的base64格式

php
$client->buildPoster("80058c79d1e2e617", $params)->b64String();
$client->buildPoster("80058c79d1e2e617", $params)->b64String();