Open boehlim377 opened 1 month ago
The TCPDF documentation uses file://
to indicate an absolute path to the certificate file. In your case, it looks like you are using a Windows path.
Try changing the certificate path to this:
$certificate = 'file:///C:/projets/my Project/test.pfx';
file://
: This tells TCPDF that you are providing an absolute path to the file.
/C:/projets/my Project/test.pfx
: This is the absolute path to your .pfx file on Windows, with slashes (/) instead of backslashes ().
Important: Make sure that the test.pfx file actually exists in the specified path and that TCPDF has permissions to read it.
in any case, i suggest you not to work with Windows but to use a Linux machine for PHP development. WSL2 could be a solution.
Regards Cristian
Hi Cristian,
It doesn't work even with "file://" at the beginning, because the path is still cut off.
You're certainly right that there are other ways to solve the problem. The simplest way is to put the project and the certificate etc. in a path without spaces.
But I think a package should be able to handle that. I've already described one possibility. It works for me like that.
Regards Max
If the project is in a folder that contains a space, the openssl command will not work. Because then the Temp folder cannot be used. If the certificate to be used has a space (e.g. in the path), it won't work either
The problem occurs in the file \src\Sign\ManageCert.php in Line 81
$openSslCommand = "openssl pkcs12 -in {$pfxPath} -out {$output} -nodes -password pass:{$shellArgPassword} {$legacyFlag}";
In the a1TempDir function the slashes should be replaceced with DIRECTORY_SEPARATOR. (Helpers\helpers.php line 109 and 112)
To Reproduce
Expected behavior All used paths (certificate, temp) should be escaped.
Versions involved:
possible fix