rton/laravel-qpdf-php-wrapper 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

rton/laravel-qpdf-php-wrapper

最新稳定版本:1.0.2

Composer 安装命令:

composer require rton/laravel-qpdf-php-wrapper

包简介

A Laravel service provider for the rton/qpdf-php-wrapper package.

README 文档

README

A Laravel service provider for the rton/qpdf-php-wrapper package.

Package Installation

copmoser require rton/laravel-qpdf-php-wrapper

Laravel

Add the service provider to the providers array in config/app.php

Rton\laravel-qpdf-php-wrapper\ServiceProvider::class,

Add to your facades:

'Qpdf' => Rton\laravel-qpdf-php-wrapper\Facades\Qpdf.php,

Usage

// Get qpdf version
Qpdf::getQpdfVersion();

// Check if file is pdf
Qpdf::fileIsPdf($pathToFile);

// Get number of pages in a pdf
Qpdf::getNumberOfPages($pathToFile);

// Rotate range of files in a pdf
Qpdf::rotate($pathToFile, Rton\QpdfPhpWrapper\ENUMS\Rotation::RIGHT, '2-4');

// Trim pdf to page range
Qpdf::trimToRange($pathToFile, '4-z'); // "z" indicates end of file

// Copy range from pdf into a new pdf
Qpdf::copyPages($pathToFile, $pathToOutput, '1,3,5');

// Remove pages from a pdf
Qpdf::removePages($pathToFile, '2,4');

// Overlay a pdf on a range of pages
Qpdf::applyStamp($pathToFile, $fileToOverlay);

// Combine ranges from multiple files into a single pdf
$files = [
  [$pathOne, '1'],
  [$pathTwo, '4-7'],
  [$pathThree, '9-z'],
  // ...
];
Qpdf::combineRangesFromFiles($files, $pathToOutput);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-08-30