Link to home
Start Free TrialLog in
Avatar of mankis
mankisFlag for Croatia

asked on

pdftk- merge secured and not secured pdf files

I use pdftk to merge uploaded pdfs. Someone uploaded pdf file that is flaged as secured, and now merging is not working.
This is my code in PHP:  
$command = 'pdftk '.$filesstring.' cat output '.$databasefilename;
$result = shell_exec($command);
  header('Content-disposition: attachment; filename='.$databasefilename);
  header('Content-type: application/pdf');
  readfile($databasefilename);

Open in new window

Is there some solution for secured files, to unlock it before merging or something else?
ASKER CERTIFIED SOLUTION
Avatar of Joe Winograd
Joe Winograd
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi mankis,
Have you had a chance to try QPDF yet? Regards, Joe
Avatar of mankis

ASKER

I haven't, sorry. But I will. I have to wait for provider to install it for me. I will accept your answer and if I have more questions after I try it I will start new question. Thanks.
Hi mankis,
I'm going to suggest that you re-open this question and wait for your provider to install QPDF. It's important that proposed answers to questions be confirmed as working, so simply accepting my answer when you haven't tried it is not the right thing to do, much as I realize that's exactly what you were trying to do. I really don't mind waiting for a while, and then if it doesn't work for you (even though it did for me), we can continue the troubleshooting. To re-open the question, click on the Request Attention link in the upper right (under your question). Regards, Joe