承接 kampak/libsignpdf 相关项目开发

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

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

kampak/libsignpdf

Composer 安装命令:

composer require kampak/libsignpdf

包简介

This is a library for pdf signing

README 文档

README

  1. What is LibSignPDF?
  2. Requirements
  3. Development quickstart
  4. Authors

What is LibSignPDF?

LibSignPDF is a library to create signature annotation on PDF.

LibSignPDF provides a signature annotation for invisible signature and visible signature. This library also support PAdES signature and multiple signature. This library not provide CMS. The CMS havee to provide in another system.

Requirements

To build LibSignPDF lib you'll need:

  • qpdf

Development quickstart

LibSignPDF can be used on various operating systems because it is compiled into binary code that can be executed directly by the machine. LibSignPDF is created using the rust programming language which is then compiled into a shared library.

Warning: LibSignPDF is known to be working in cross-compilation toolchains (eg. MacOS/Linux/Windows) but in usage still need qpdf package because the qpdf is not static linking when it compiled.

Install package

From the composer project run:

composer require kampak/libsignpdf

Example usage

This is an example code to use LibSignPDF library

use Kampak\LibSignPDF\SignPDF;

// This is the parameters that you need for generating CMS
$options = [
    'email' => "test@libsignpdf.com",
    'password' => "P@ssw0rd"
];

function signDigestFunction($digest, $options = []) {

    // START YOUR CODE
    // Please insert your code to get cms by sign the digest
    $yourCMS = "get_your_cms_from_your_server_by_sign_the_digest";

    // END YOUR CODE
    $buffer = FFI::new("char[" . (strlen($yourCMS) + 1) . "]", false);
    FFI::memcpy($buffer, $yourCMS, strlen($yourCMS));
    $buffer[strlen($yourCMS)] = "\0";
    $response = FFI::new("char *", false);
    $response = FFI::addr($buffer[0]);
    return $response;
}

// Create an instance of PDFSigner
$signer = new SignPDF("signDigestFunction", $options);

// Sign the PDF
$inputFile = "your_input_pdf_path";
$outputFile = "your_output_pdf_path";
$visualizationFile = "your_image_visualization_path";

$signer->signPDF(
    $inputFile, // input file
    $outputFile, // output file
    $visualizationFile, // visualization file
    "https://example.com", // url for QRCode
    1, // page will be place the signature
    1, // isPades signature
    0, // type od signature (0 for invisible, 1 for visible image)
    100.0, // x position on pdf for place visualization of signature (start on bottom left)
    200.0, // y position on pdf for place visualization of signature (start on bottom left)
    300.0, // width of visualization for place signature (start on bottom left)
    400.0 // height of visualization for place signature (start on bottom left)
);

Authors

Warning: Please don't use personal email addresses for technical support inquries, but create github issues instead.

LibSignPDF is currently developed and maintained by LibSignPDF, together with LibSignPDF and others. See the file

kampak/libsignpdf 适用场景与选型建议

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-24