webpractik/ocf-converter-sdk
最新稳定版本:1.0.0
Composer 安装命令:
composer require webpractik/ocf-converter-sdk
包简介
SDK for onlineconvertfree.com file conversion API
README 文档
README
SDK for onlineconvertfree.com file conversion API.
Installation & Usage
Requirements
PHP 7.4 and later. Should also work with PHP 8.0.
Composer
The recommended way to install SDK is through Composer.
composer require webpractik/ocf-converter-sdk
Getting Started
Please follow the installation procedure and then start from the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); $apiKey = 'myApiKey'; $client = new Webpractik\OcfConverter\Sdk\OcfClient($apiKey); $filePath = '/path/to/file/to/convert.png'; $extensionToConvertTo = 'pdf'; try { $task = $client->uploadFile($filePath, $extensionToConvertTo); $result = $task->waitForConversion(); if ($result->isSuccess()) { $resultUrl = $result->getResultingFileUrl(); $resultFileName = basename($resultUrl); if (file_put_contents($resultFileName, file_get_contents($resultUrl))) { $result->deleteFile(); } } } catch (Exception $e) { echo 'Exception: ', $e->getMessage(), PHP_EOL; }
License
SDK is made available under the MIT License (MIT). Please see License File for more information.
Contribution
OpenAPI Generator is used for the client generation.
Requirements
JRE and OpenAPI Generator are required for the client generation.
Client generation
To regenerate the client do the following:
- run generation command:
composer api-codegen
- reformat the generated code with your IDE.
统计信息
- 总下载量: 423
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-11-14