I'm trying to remove a protection layer of a PDF using PHP and following the method suggested in here.
But for some reasons, the output PDF file becomes a blank page. I'm not sure what I'm missing here.
This is the code:
$cmd = "gs -q -dNOPAUSE -dBATCH
-sDEVICE=pdfwrite
-sOutputFile='".$filepath."'
-c .setpdfwrite
-f '".$filepath."'";
$result = exec($cmd);
UPDATE
[Deleted wrong file]
UPDATE 2
Sorry, I think I uploaded the wrong file. This one should be the one with password protection (or anything of sorts that is not readable).
I'm on Linux and the GS version is Ghostscript 8.70