承接 conversiontools/conversiontools-php 相关项目开发

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

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

conversiontools/conversiontools-php

最新稳定版本:1.0.3

Composer 安装命令:

composer require conversiontools/conversiontools-php

包简介

Conversion Tools REST API PHP Client library

README 文档

README

Conversion Tools is an online service that offers a fast and easy way to convert documents between different formats, like XML, Excel, PDF, Word, Text, CSV and others.

This client allows to integrate the conversion of the files into PHP applications.

To convert the files PHP Client uses the public Conversion Tools REST API.

Installation

Installation using Composer

composer require conversiontools/conversiontools-php

or without composer:

require_once('conversiontools-php/src/autoload.php');

Examples

To use REST API - get API Token from the Profile page at https://conversiontools.io/profile.

Converting file

See example convert-file.php in the ./examples/ folder.

<?php require_once __DIR__ . '/vendor/autoload.php'; use \ConversionTools\ConversionClient; // put token here from your Profile page at https://conversiontools.io/profile $token = ''; $fileOrUrlInput = 'test.xml'; $fileOutput = 'test.csv'; $options = ['delimiter' => 'tabulation']; $client = new ConversionClient($token); try { $client->convert('convert.xml_to_csv', $fileOrUrlInput, $fileOutput, $options); } catch (Exception $e) { print 'Exception: ' . $e->getMessage() . "\n"; }

Converting URL

See example convert-url.php in the ./examples/ folder.

<?php require_once __DIR__ . '/vendor/autoload.php'; use \ConversionTools\ConversionClient; // put token here from your Profile page at https://conversiontools.io/profile $token = ''; $fileOrUrlInput = 'https://google.com'; $fileOutput = 'result.pdf'; $options = []; $client = new ConversionClient($token); try { $client->convert('convert.website_to_pdf', $fileOrUrlInput, $fileOutput, $options); } catch (Exception $e) { print 'Exception: ' . $e->getMessage() . "\n"; }

API

Create ConversionClient instance with a token.

use \ConversionTools\ConversionClient; $client = new ConversionClient('<token>');

Where <token> is API token from the account's Profile page https://conversiontools.io/profile.

Convert input file and download the result

$client = new ConversionClient($token); try { $client->convert('<conversion type>', $fileOrUrlInput, $fileOutput, $options); } catch (Exception $e) { print 'Exception: ' . $e->getMessage() . "\n"; }

Where

  • <conversion type> is a specific type of conversion, from API Documentation.
  • $fileOrUrlInput is the filename of the input file, or URL of the file to convert (when applicable)
  • $fileOutput is the filename of the output file
  • $options is a PHP array with options for a corresponding converter, for example:
$options = ['delimiter' => 'tabulation'];

Requirements

PHP version 5.4.0 or later.

Documentation

List of available Conversion Types and corresponding conversion options can be found on the Conversion Tools API Documentation page.

License

Licensed under MIT.

Copyright (c) 2021 Conversion Tools

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固