LibreSign / LibreSign/libresign

Failed to merge PDF with footer

Open
#6,235 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
818
Forks
146
Avg merge
11h 31m
Merged PRs (30d)
326

Description

Describe the bug

Failed to merge PDF with footer when installing libraries manually..

To reproduce
  1. Manually place JSignPdf.jar in /opt/libresign.
  2. Set correct ownership and permissions (www-data:www-data, 755)
  3. Installed java,pdftk from debian repositories
  4. Set the path manually
  5. php occ config:app:set libresign jsignpdf_path --value "/opt/libresign/jsignpdf-2.3.0/JSignPdf.jar"
  6. php occ config:app:set libresign java_path --value "/usr/bin/java"
  7. php occ config:app:set libresign pdftk_path --value "/usr/bin/pdftk"
Expected behavior

LibreSign should merge the PDF with the footer successfully, even if the libraries were installed manually instead of "occ libresign:install --all"

Screenshots
Image Image
Environment information
  1. Nextcloud version: Nextcloud Hub 10(31.0.5)
  2. LibreSign version: 11.6.0
  3. PHP version: 8.2.28
  4. OS: debian 12 (bookworm)
  5. Java: openjdk 17.0.17
  6. JSignPdf version: 2.3.0
  7. pdftk: pdftk port to java 3.3.2 a Handy Tool for Manipulating PDF Documents
root@nextcloud:/var/www/nextcloud# php occ config:app:get libresign java_path
/usr/bin/java
root@nextcloud:/var/www/nextcloud# php occ config:app:get libresign pdftk_path
/usr/bin/pdftk
root@nextcloud:/var/www/nextcloud# php occ config:app:get libresign jsignpdf_path
/opt/libresign/jsignpdf-2.3.0/JSignPdf.jar
root@nextcloud:/var/www/nextcloud#
Additional context

For java, pdftk, and jsignpdf, the “Invalid hash of binary files” error is expected because I manually set the paths instead of using occ libresign:install --all, so the verification fails. However, this should not be a problem since the paths are correctly set. I didn’t want to install these libraries through LibreSign because they are already installed on my system from repositories except jsignpdf and I want to use them.

Does it have to be installed through occ libresign:install --all? If not, what could be the possible issues?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the PDF footer merge with the manually configured java_path, pdftk_path, and jsignpdf_path values, then inspect the libresign:install --all flow and the binary hash verification behavior. Compare the manual-install path with the installed-library path and confirm that merging succeeds without requiring LibreSign-managed binaries.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.