Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
Signing a password protected document |
Post Reply |
Author | |
Bigun
Beginner Joined: 23 Jul 19 Location: Irun Status: Offline Points: 9 |
Post Options
Thanks(0)
Posted: 24 Jul 19 at 12:25PM |
Hi all,
I've been required to digitally sign an already password protected document with no success. I'm using QuickPdf v11.13. So far I can digitally sign unprotected PDFs, with or without images, with no problem. Basically:
But the same process with a password protected PDF does not sign the resulting PDF. This protected PDF already has an empty signature field and has no constraints filling fields, signing... The original protected PDF (password; owner) is https://we.tl/t-x0JuwBxfqQ The resulting not signed PDF is: https://we.tl/t-uh06rFQf1r Can anyone guide me or give me any hint? Thank you very much |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Bigun,
did you read the description regarding NewSignProcessFromFile? https://www.debenu.com/docs/pdf_library_reference/NewSignProcessFromFile.php There you can read: "...Creates a new digital signature process using a file as the source document...". There is a password as parameter ;-) If the password is protected the original owner wanted to protect it ;-) If it's only the main password you can do it this way: // ... QP.LoadFromFile(FileName, ''); If QP.EncryptionStatus > 0 Then QP.Decrypt; // ... then you can begin with your signing process. Cheers and welcome here, Ingo |
|
Cheers,
Ingo |
|
Bigun
Beginner Joined: 23 Jul 19 Location: Irun Status: Offline Points: 9 |
Post Options
Thanks(0)
|
Thank you for your answer Ingo, but I'm afraid I'm already starting the signing process using it:
int SignProcessID= QP->NewSignProcessFromFile(sSourcePdf, sOwnerPassword); ... If I decrypt SourcePdf as you suggest, the signature process goes well but I'm not able to Encrypt the resulting signed PDF, so I get a signed unprotected PDF: int Permisos= QP->EncodePermissions(1, 0, 0, 0, 1, 1, 0, 1); int iRes= QP->Encrypt(sPassOwner, "", Strength, Permisos); QP->SetSignProcessPFXFromFile(SignProcessID, PFXFileName, PFXPassword); ... QP->EndSignProcessToFile(SignProcessID, sOutput); // <== should be signed and password protected On the other hand, if I don't decrypt it, the resulting file, though protected, does not get signed. I'll keep trying. Thanks for your help!! |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Bigun,
here's a kb-document from Debenu: https://www.debenu.com/kb/add-visual-digital-signature-to-a-pdf-programmatically/ With this link you'll find interesting hints from Rowan: http://www.quickpdf.org/forum/visible-digital-signature_topic2563.html A quick read through the content lt me think that signing doesn't need a password? If you simply rewrite the pdf the signature is broken and all readers are telling that the signature in the loaded pdf was broken... |
|
Cheers,
Ingo |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store