libriciel / php-office-clients
PHP 客户端,用于文档合并服务。
1.0.0-alpha.5
2024-06-13 14:58 UTC
Requires
- php: >=7.4.0
- ext-curl: *
- ext-fileinfo: *
- ext-json: *
- ext-soap: *
- composer/installers: *
- guzzlehttp/guzzle: ^7.7
- phpxmlrpc/phpxmlrpc: ^4.5
- symfony/polyfill-php81: ^1.28
Requires (Dev)
- ext-zip: *
- phpmd/phpmd: ^2.14
- phpunit/phpunit: ^9.6
- sebastian/phpcpd: ^6.0
- squizlabs/php_codesniffer: ^3.7
- wapmorgan/php-deprecation-detector: ^2.0
- dev-master
- 1.0.0-alpha.5
- 1.0.0-alpha.4
- 1.0.0-alpha.3
- 1.0.0-alpha.2
- 1.0.0-alpha.1
- dev-10-le-type-lines-n-est-pas-correctement-pris-en-compte
- dev-2-amelioration-de-la-gestion-des-proxy
- dev-8-ajouter-la-possibilite-d-utiliser-vectorstodoc-pour-la-conversion-de-pdf-en-odt
- dev-7-utilisation-de-1-0-0-rc-4-harmonisation-de-builder-add-avec-builder-addfield-qui-permet-une
This package is not auto-updated.
Last update: 2024-09-26 13:04:28 UTC
README
php-office-clients
提供统一接口的 PHP 客户端,用于文档合并服务,无需依赖 框架。
- lspdf2odt,将 PDF 转换为 ODT
- flow 或 gedooo / golem,在 ODT 模型中合并变量
- cloudooo 或 unoserver,通过 LibreOffice 转换文档格式
默认配置通过环境变量进行。
已测试与
- pdf2odt
- 融合
- 转换
旧版库
使用方法
了解更多
示例
Pdf2Odt
use Libriciel\OfficeFusion\Pdf2Odt\Client\ClientFactory;
try {
$documentContent = ClientFactory::create()
->pdf2odt('/data/workspace/document.pdf');
// ...
} catch(\Throwable $exc) {
// ...
}
融合
use Libriciel\OfficeFusion\Fusion\Client\ClientFactory;
use Libriciel\OfficeFusion\Fusion\Helper\Builder;
try {
// Création des données
$main = (new Builder())
->addField('entity_name', 'Libriciel SCOP')
// ...
;
$documentContent = ClientFactory::create()
->fusion('/data/workspace/template.odt', $main->getResult());
// ...
} catch(\Throwable $exc) {
// ...
}
转换
use Libriciel\OfficeFusion\Conversion\Client\ClientFactory;
try {
$documentContent = ClientFactory::create()
->conversion(file_get_contents('/data/workspace/document.odt'), 'odt', 'pdf');
// ...
} catch(\Throwable $exc) {
// ...
}
开发
docker compose -f docker-compose-dev.yml up -d --build
docker compose -f docker-compose-dev.yml logs -f
docker compose -f docker-compose-dev.yml exec php-office-clients /bin/bash
docker compose -f docker-compose-dev.yml down --remove-orphans --volumes
composer pre-commit
不完整的集成测试
flow
应该发送410 Gone
(从1.0.0-rc.4
开始)(当前测试被 跳过)