Skip to content

This package is only wrapper of JSignPdf to use in PHP

Notifications You must be signed in to change notification settings

JSignPdf/jsignpdf-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsignpdf-php

This package is only wrapper of JSignPdf to use in PHP

Installation:

$ composer require jeidison/jsignpdf-php

Examples

use Jeidison\JSignPDF\JSignPDF;
use Jeidison\JSignPDF\Sign\JSignParam;

$param = JSignParam::instance();
$param->setCertificate(file_get_contents('/path/to/file/certificate.pfx'));
$param->setPdf(file_get_contents('/path/to/file/pdf_to_sign.pdf'));
$param->setPassword('certificate_password');

$jSignPdf   = new JSignPDF($param);
$fileSigned = $jSignPdf->sign();
file_put_contents('/path/to/file/file_signed.pdf', $fileSigned);

With Java Installed:

$param->setIsUseJavaInstalled(true);

With standalone Java:

$param->setJavaPath('/path/to/bin/java');

With JSignPDF bin:

$param->setjSignPdfJarPath('/path/to/jsignpdf');

Without JSignPDF bin:

composer require jsignpdf/jsignpdf-bin

File signed as base64:

$param->setIsOutputTypeBase64(true);

Change temp directory:

$param->setTempPath('/path/temp/to/sign/files/');

Change parameters of JSignPDF:

$param->setJSignParameters("-a -kst PKCS12 -ts https://freetsa.org/tsr");

Credits