virdiggg/merge-files 问题修复 & 功能扩展

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

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

virdiggg/merge-files

最新稳定版本:2.2.0

Composer 安装命令:

composer require virdiggg/merge-files

包简介

Merge words, excel, PDF and image into a single PDF

README 文档

README

Not support image inside docx/doc

I don't plan to update this library in the meantime

mbstring extension is needed

HOW TO USE

  • Install this library with composer
composer require virdiggg/merge-files
  • Install Ghostscript and make sure it can be called in command promp with gs. You will get something like this when you type gs.
$ gs
$ GPL Ghostscript 10.04.0 (2024-09-18)
$ GS >
  • Create function to call this library
<?php

require_once __DIR__ . '/../vendor/autoload.php';

use Virdiggg\MergeFiles\Merge;

try {
    $mf = new Merge();
    $mf->setAuthor('Me');
    $mf->setCreator('Also Me');
    $mf->setOutputName('mergedpdf.pdf');
    $mf->setOutputPath(__DIR__ . '/output/');
    // $mf->setKeywords(['pdf', 'word', 'excel', 'image']);
    $mf->setTitle('Merged PDF'); // Mandatory
    $mf->setSubject('Merged PDF'); // Mandatory
    // $mf->setPassword('password'); // Mandatory if Permission is set
    // $mf->setPermissions(['copy']); // Optional, must be an array

    $files = [
        __DIR__.'/input/new_pdf.pdf',
        __DIR__.'/input/Book1.xlsx',
        __DIR__.'/input/download.pdf',
        __DIR__.'/input/word.docx',
        __DIR__.'/input/Wikipedia-logo-v2.png'
    ];
    $mf->mergeToPDF($files);
} catch (Exception $e) {
    echo "Error: " . $e->getMessage();
}

Permission List

You can use any of the options listed below. Use [] (an empty array) if you do not want to set any permissions.

  • copy
  • print
  • modify
  • annot-forms
  • fill-forms
  • extract
  • assemble
  • print-highres

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-11-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固