imaginativeimpact/pdf-version-converter
最新稳定版本:v2.0.0
Composer 安装命令:
composer require imaginativeimpact/pdf-version-converter
包简介
PHP library for converting the version of PDF files (for compatibility purposes).
README 文档
README
PHP library for converting the version of PDF files (for compatibility purposes).
Requirements
- PHP 5.3+
- Ghostscript (gs command on Linux)
Installation
Run composer require imaginativeimpact/pdf-version-converter dev-master or add the follow lines to your composer.json and run composer install:
{
"require": {
"imaginativeimpact/pdf-version-converter": "^2.0"
}
}
Usage
Guessing a version of PDF File:
<?php // import the composer autoloader require_once __DIR__.'/vendor/autoload.php'; // import the namespaces use ImaginativeImpact\PDFVersionConverter\Guesser\RegexGuesser; // [..] $guesser = new RegexGuesser(); echo $guesser->guess('/path/to/my/file.pdf'); // will print something like '1.4'
Converting file to a new PDF version:
<?php // import the composer autoloader require_once __DIR__.'/vendor/autoload.php'; // import the namespaces use Symfony\Component\Filesystem\Filesystem, ImaginativeImpact\PDFVersionConverter\Converter\GhostscriptConverterCommand, ImaginativeImpact\PDFVersionConverter\Converter\GhostscriptConverter; // [..] $command = new GhostscriptConverterCommand(); $filesystem = new Filesystem(); $converter = new GhostscriptConverter($command, $filesystem); $converter->convert('/path/to/my/file.pdf', '1.4');
Running unit tests
Important: Tests are currently not working and need to be updated
Run ./vendor/bin/phpunit -c tests
统计信息
- 总下载量: 905
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-09-13