From 9f3d2f01e677ff04eeeb674dc76ab445af81420a Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Thu, 12 Dec 2024 12:30:04 -0300 Subject: [PATCH] fix: set user language hardcoded The problem: The follow code verify the string in English, but if the operational system is in another language, don't will match the string: https://github.com/JSignPdf/jsignpdf-php/blob/v1.2.5/src/Sign/JSignService.php#L30-L33 English text: Finished: Signature succesfully created. German text: Fertig: Signatur erfolgreich erzeugt. To solve was necessary to mahe the java user language hardcoded as English. Signed-off-by: Vitor Mattos --- src/Sign/JSignService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sign/JSignService.php b/src/Sign/JSignService.php index 8ba635d..fae57ce 100644 --- a/src/Sign/JSignService.php +++ b/src/Sign/JSignService.php @@ -127,7 +127,7 @@ private function commandSign(JSignParam $params) $this->throwIf(!file_exists($jSignPdf), 'Jar of JSignPDF not found on path: '. $jSignPdf); $password = escapeshellarg($params->getPassword()); - return "$java -jar $jSignPdf $pdf -ksf $certificate -ksp {$password} {$params->getJSignParameters()} -d {$params->getPathPdfSigned()} 2>&1"; + return "$java -Duser.language=en -jar $jSignPdf $pdf -ksf $certificate -ksp {$password} {$params->getJSignParameters()} -d {$params->getPathPdfSigned()} 2>&1"; } private function javaCommand(JSignParam $params)