intoolswetrust / jsignpdf

PDF signing software written in Java. It supports visible signatures, timestamping, certificate verification and many other cool features
https://intoolswetrust.github.io/jsignpdf/
Other
315 stars 121 forks source link

Support signing using PDF signatures (depends on upstream openpdf changes) #185

Open Alkaid-Benetnash opened 3 months ago

Alkaid-Benetnash commented 3 months ago

Currently, vector images (svg, pdf) cannot be used as signature graphic. Related issue: #183

I proposed changes to the upstream openpdf (https://github.com/LibrePDF/OpenPDF/pull/1181) to support PDF as a visible signature.

This PR includes changes to jsignpdf that make use of that new feature. However, maven decides that jsignpdf should depend on a pretty old version (1.3.30) of openpdf on my end, which complicated the testing of this new feature.

I have tested in two different setups:

  1. jsignpdf + openpdf 1.3.30
  2. jsignpdf + openpdf master (2.0.3)

For case 1, this PR contains all jsignpdf changes. However my openpdf PR (https://github.com/LibrePDF/OpenPDF/pull/1181) is not compatible with 1.3.30 (https://github.com/LibrePDF/OpenPDF/tree/1.3.30). Instead, please apply the following patch to openpdf 1.3.30:

v1.3.30-Support-using-PDF-in-addition-to-images-as-the-signa.patch.txt

For case 2, the openpdf PR contains all necessary changes. However, the current jsignpdf is not compatible with the latest openpdf. Please apply the following patch on top of this jsignpdf PR:

For-testing-purpose-adapt-jsignpdf-to-openpdf-2.0.3.patch.txt

PS: if you want to use svg signatures, it is very easy to convert them to PDF: inkscape in.svg --export-type=pdf -o out.pdf