承接 gablem/aftfpdf 相关项目开发

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

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

gablem/aftfpdf

Composer 安装命令:

composer require gablem/aftfpdf

包简介

aftFPDF is an extended version of the tFPDF library, with added AcroForm support.

README 文档

README

Description

aftFPDF is a fork of tFPDF that introduces additional features, including AcroForm support and transparency. It is designed to be 100% backward compatible with tFPDF, allowing for an effortless, drop-in replacement in existing projects.

Features

  • All features from tFPDF including UTF8 support for foreign language characters
  • Create AcroForm with text fields, signature fields, checkboxes, and radio buttons.
  • Control element transparency using SetAlpha.

Requirements

  • Compatible with PHP up to version 8.3+

Usage

Using AcroForm Fields

Adding Checkboxes

Use the CheckboxField function to add checkboxes to your PDF. The $properties array can include:

  • value: Assign a value to differentiate checkboxes. Checkboxes with the same name become mutually exclusive.
  • checked: Set to true to pre-check the checkbox.
$pdf->CheckboxField('option1', 20, 140, 5, 5, array('value' => 'A', 'checked' => true));
$pdf->CheckboxField('option1', 20, 150, 5, 5, array('value' => 'B'));
$pdf->CheckboxField('option2', 20, 160, 5, 5, array('checked' => true)); // Independent checkbox

Adding Text Fields

Use the TextField function to add text input fields. The $properties array can include:

  • value: The text displayed inside the field.
  • signature: Set to true to make the field a signature field.
  • multiline: Set to true to allow multiple lines of text.
$pdf->TextField('fullname', 'John Doe', 20, 180, 60, 10);
$pdf->TextField('comments', '', 20, 200, 100, 30, array('multiline' => true));
$pdf->TextField('signature', '', 20, 250, 80, 20, array('signature' => true));

Setting Transparency (>=v1.1.0)

You can use the SetAlpha function to control the transparency of elements in your PDF.

require('aftFPDF.php');

$pdf = new aftFPDF();

$pdf->AddFont('DejaVuSans', '', 'DejaVuSans.ttf', true);
$pdf->SetFont('DejaVuSans');

$pdf->AddPage();

// Set an alpha value for the rectangle
$pdf->SetAlpha(0.5);
$pdf->Rect(20, 20, 50, 50, 'F');

// Set an 50% alpha value for the fill, but keep 100% for the stroke
$pdf->SetAlpha(0.5, 1);
$pdf->Rect(40, 40, 50, 50, 'DF');

// Also works with text
$pdf->SetFontSize(64);
$pdf->SetAlpha(0.5);
$pdf->SetTextColor(255, 0, 0);
$pdf->Text(45, 62, "Hello World");

$pdf->SetTextColor(0, 0, 255);
$pdf->Text(46, 63, "Hello World");

$pdf->Output('output.pdf', 'F');

License

This project is licensed under the GNU Lesser General Public License v3.0 (LGPL-3.0). You are free to use, modify, and distribute this library under the terms of the LGPL-3.0 license.

Support

If you encounter issues or have questions, feel free to contact me at gabriel@gablem.com.

gablem/aftfpdf 适用场景与选型建议

gablem/aftfpdf 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 28 次下载、GitHub Stars 达 2, 最近一次更新时间为 2025 年 01 月 28 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「pdf」 「unicode」 「fpdf」 「tfpdf」 「aftfpdf」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 gablem/aftfpdf 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 gablem/aftfpdf 我们能提供哪些服务?
定制开发 / 二次开发

基于 gablem/aftfpdf 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LGPL-2.1-only
  • 更新时间: 2025-01-28