I need to perform some editing actions on many PDFs across a wordpress site programmatically. Using MPDF I can access and edit many of them just fine. The issue is a lot of these files are also encrypted and MPDF gives the following error when trying to open the file:
This PDF document is encrypted and cannot be processed with FPDI.
The problem I have is that this encryption appears to be an empty password. If I do not modify the file and simply download it, the info of the file shows it has Security: Password Encrypted, if I try to open the file in any kind of PDF viewer or web browser it opens fine and does not prompt for a password.
I have found this composer package I have considered trying but it requires PDFtk to be installed on the server but I do not have permission to install this. Is there any other kind of alternative to open a PDF file in PHP that has this kind of "empty" encryption ?