Download the PHP package jsignpdf/jsignpdf-php without Composer

On this page you can find all versions of the php package jsignpdf/jsignpdf-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package jsignpdf-php

jsignpdf-php

This package is only wrapper of JSignPdf to use in PHP

Installation:

Examples

With Java Installed:

With standalone Java:

setJavaPath() takes only the path to the java executable. Applications that need JVM options or environment variables — for example a self-managed JSignPdf install that needs -Duser.home and JSIGNPDF_HOME — set them separately:

With JSignPDF bin:

With specific Java or JSignPdf version:

Without JSignPDF bin:

File signed as base64:

Change temp directory:

Change parameters of JSignPDF:

An option that takes a value is written as option => value, and a flag as an item without a key:

This is what tells the package which item is an option and which one is its value, so a value that looks like an option is never mistaken for one:

setJSignParameters() replaces the current parameters; the package escapes every value for you. Use addJSignParameters() to add more options without reading the current ones first:

Existing signature fields

JSignPdf 3.2 can inspect existing signature fields in a PDF. Only the PDF is required for inspection; a certificate and signing password are not needed.

Each signature field exposes its name, page, rectangle coordinates and whether it is signed or hidden. isBlank() is the opposite of isSigned(), and hasVisibleRectangle() reports whether the field has a non-zero rectangle.

To sign an existing blank signature field, select it by name before signing:

The value passed to setSignatureField() is passed directly to JSignPdf. Names containing spaces or Unicode characters are supported. JSignPdf also supports its own field selectors such as auto and #1; when a field has one of those literal names, JSignPdf gives the field name precedence.

Passwords

Besides the certificate password of setPassword(), JSignPdf takes a password for the private key, for encrypted documents and for the timestamping server. None of them is passed on the command line, where any user of the machine could read it from ps or /proc/<pid>/cmdline: the package sends every one of them to JSignPdf through stdin.

Passing one of those options to setJSignParameters() or addJSignParameters() works too, and the value is taken out of the command line just the same:

A password option always takes its value with it: ['-tsp'] alone, or the certificate password as ['-ksp' => '...'] — which belongs to setPassword() — is refused with an InvalidArgumentException instead of reaching the command line.

JSignPdf reads one password per line from stdin, so a password cannot contain a line break: every setter above, and the parameters, reject one with an InvalidArgumentException. Any other value is supported, spaces, shell metacharacters and non-ASCII characters included.

JSignPdf 3.x

This package targets JSignPdf 3.x, which needs a Java 21+ runtime. JSignPdf 2.x is no longer supported: the certificate password is now sent to JSignPdf through stdin, and 2.x has no option to read it from there. Pointing setJSignPdfDownloadUrl() or setJSignPdfPath() at a 2.x release stops working.

Two changes of JSignPdf 3.1 are worth knowing about:

Together they make signing a PDF older than 1.6 fail with the default parameters. To sign such a file, either turn off the append mode with --overwrite or pick an algorithm the PDF version supports:

The -a flag is kept by JSignPdf 3.1 as a no-op.

Docker Environment

The repository ships a minimal Docker setup (Dockerfile and compose.yml) with the extensions the test suite needs.

Checks, the same ones the CI runs:

Usage example

To sign a PDF end to end. It downloads the JRE and JSignPdf into tmp/ on the first run:

Credits


All versions of jsignpdf-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-openssl Version *
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jsignpdf/jsignpdf-php contains the following files

Loading the files please wait ...