承接 murkrow/pdf-utils 相关项目开发

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

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

murkrow/pdf-utils

最新稳定版本:1.0

Composer 安装命令:

composer require murkrow/pdf-utils

包简介

A poppler-utils wrapper for Laravel applications

README 文档

README

Latest Stable Version Total Downloads

A wrapper for popper-utils for your Laravel project

Prerequisites

Ensure to have poppler-utils installed on your system. You can install it with the following command:

sudo apt-get install poppler-utils

or if you are using a Mac:

brew install poppler

Installation

You can install the package via composer:

composer require murkrow/pdf-utils

You can publish the config file with:

php artisan vendor:publish --provider="Murkrow\PdfUtils\PdfUtilsServiceProvider"

Usage

Convert PDF to text

use Murkrow\PdfUtils\Services\ParsePdfTextService;
ParsePdfTextService::create()
        ->setInputFile("example.pdf")
        ->flattenText(false)
        ->execute()
        ->getOperationResult()

Merge multiple PDFs into one

use Murkrow\PdfUtils\Services\MergePdfService;
MergePdfService::create()
        ->setInputFiles(["1.pdf", "2.pdf"])
        ->addInputFile("3.pdf")
        ->setOutputFile("123.pdf")
        ->execute();

Split PDF into multiple PDFs

use Murkrow\PdfUtils\Services\SplitPdfService;
SplitPdfService::create()
        ->setInputFile("123.pdf")
        ->setOutputFilesDirectory("splitting")
        ->fromPage(1)
        ->toPage(3)
        ->setOutputFileNamePrefix("output")
        ->execute();

Extract page range from PDF

use Murkrow\PdfUtils\Services\ExtractPdfPageRangeService;
ExtractPdfPageRangeService::create()
    ->fromPage(1)
    ->toPage(2)
    ->setInputFile('big.pdf')
    ->setOutputFile('subset.pdf')
    ->execute();
        

Get PDF info (incomplete)

use Murkrow\PdfUtils\Services\GetPdfInfoService;
$result = GetPdfInfoService::create()
        ->setInputFile("123.pdf")
        ->execute();

dd($result->pages);

Testing

vendor/bin/pest

Contributing

Contributions are welcome, you are free to open a PR or an issue.

Changelog

Please see CHANGELOG for more information on what has changed recently.

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-10-17