定制 mops1k/unoserver-client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

mops1k/unoserver-client

最新稳定版本:v0.0.2

Composer 安装命令:

composer require mops1k/unoserver-client

包简介

PHP client for unoserver(ex. unoconv) converter.

README 文档

README

Simple library to run unoconvert inside your php applications.

Installation

composer require mops1k/unoserver-client

Usage example

  1. From document:
<?php
use Unoserver\Converter\ClientBuilder;
use Unoserver\Converter\Wrapper\Remote;
use Unoserver\Converter\Source\Format;

$builder = new ClientBuilder();
$builder->init(Remote::class, [
    'command' => '/usr/bin/unoconvert', // path to unoconvert binary
    'host' => '127.0.0.1', // remote unoserver host
    'port' => 2003, // remote unoserver port
]);
$client = $builder->fromDocument('/document/path.docx'); // set path to file convert from
$client->toFormat(Format::PDF); // set format to convert to
$file = $client->convert(); // will return \SplFileInfo object with converted file
  1. From spreadsheet:
<?php
use Unoserver\Converter\ClientBuilder;
use Unoserver\Converter\Wrapper\Remote;
use Unoserver\Converter\Source\Format;

$builder = new ClientBuilder();
$builder->init(Remote::class, [
    'command' => '/usr/bin/unoconvert', // path to unoconvert binary
    'host' => '127.0.0.1', // remote unoserver host
    'port' => 2003, // remote unoserver port
]);
$client = $builder->fromSpreadsheet('/document/path.xlsx'); // set path to file convert from
$client->toFormat(Format::PDF); // set format to convert to
$file = $client->convert(); // will return \SplFileInfo object with converted file

More docs soon...

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-05