承接 matrix2305/mcpdf 相关项目开发

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

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

matrix2305/mcpdf

Composer 安装命令:

composer require matrix2305/mcpdf

包简介

PHP wrapper for mcpdf

README 文档

README

This package uses Java package created by m-click (m-click/mcpdf).

Mcpdf

Mcpdf is an alternative to PDFtk with fixed unicode issues, so you can write Łódź into your forms.

It implements a small subset of PDFtk for which it implements compatible command line interface, so it can be used as a drop-in replacement for this subset of commands.

Internally it uses the iText PDF library.

Getting Started

Make sure you have installed a Java Runtime Environment such as OpenJDK.

Xfdf

This package has XfdfDocument class for generating Xfdf document.

Example of filling PDF fields:

    use matrix2305\Pdf\MCPDF;

    require 'vendor/autoload.php';
    
    $mcpdf = new MCPDF();
    
    $xfdf = new \matrix2305\Xfdf\XfdfDocument();
    $xfdf->addField('date', '23.05.1998');
    $xfdfPath = __DIR__.'/test.xfdf';
    $xfdf->save($xfdfPath);
    
    $mcpdf->setDataXfdfPath($xfdfPath);
    $mcpdf->setFlatten(true);
    $mcpdf->setFromPDFFilePath(__DIR__.'/test.pdf');
    $mcpdf->saveAs(__DIR__.'/output.pdf');

Example of set background PDF:

    use matrix2305\Pdf\MCPDF;

    require 'vendor/autoload.php';
    
    $mcpdf = new MCPDF();
    $mcpdf->setBackgroundPdfPath($backgroundPdfFilePath);
    $mcpdf->setFromPDFFilePath(__DIR__.'/test.pdf');
    $mcpdf->saveAs(__DIR__.'/fsafs.pdf');

Set Java path manually

    use matrix2305\Pdf\MCPDF;

    require 'vendor/autoload.php';
    
    $mcpdf = new MCPDF();
    $mcpdf->setJavaPath($pathToJava);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-09-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固