ghostfly/pdf-forms-filler 问题修复 & 功能扩展

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

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

ghostfly/pdf-forms-filler

最新稳定版本:1.2.0

Composer 安装命令:

composer require ghostfly/pdf-forms-filler

包简介

Fill Acrobat forms easily using pure PHP ! 💪

README 文档

README

forthebadge forthebadge

Build Status Coverage Status Total Downloads License composer.lock

Fill Acrobat forms easily using pure PHP ! 💪

Requirements

  • PHP >= 7.1.0

Install :

$ composer require ghostfly/pdf-forms-filler

Example :

  • clone repository
  • go to example folder
  • composer install
  • run index.php

Usage :

You need to do a PDF Form with Acrobat, and the string to convert is given by this page :

Find Form Field coordinates

Use Converter who gives you a JSON Array containing fields with locations / page, in a form usable by the Generator

$converter = new Converter($string);
$converter->getPagesWithFieldsCount();
$json = $converter->formatFieldsAsJson($pages);

echo json;

Use PDF Generator with one array containing every field with id -> value And one array containing every field with id -> llx, lly, urx, ury, page

$pdfGenerator = new PDFGenerator($coords, $data, 'P', 'pt', 'A4');
$pdfGenerator->start($original, $dest);

If your original PDF is not handled by fpdf, you can convert it using this service :

Convert PDF with "Acrobat 4.0 (PDF 1.3)"

Don't care about form fields on file to send to generator, the locations are determined using the latest PDF format.

If you need a full example : index.php.

Tests

$ ./vendor/bin/phpunit tests

Code coverage

$ ./vendor/bin/phpunit tests --coverage-text --coverage-clover build/logs/clover.xml

Done. ;)

统计信息

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

GitHub 信息

  • Stars: 24
  • Watchers: 3
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-12-10