Print Page | Close Window

How do I detect that a PDF has a digital signature

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2529
Printed Date: 08 Jan 26 at 5:11AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: How do I detect that a PDF has a digital signature
Posted By: AnnD
Subject: How do I detect that a PDF has a digital signature
Date Posted: 11 Feb 13 at 9:28PM
In my application I am adding some modifications to a PDF file.  I don't want to invalidate the digital signature, so I want to skip the modification if a file has a digital signature.  How do I determine if the file has a digital signature using the QuickPDF api?




Replies:
Posted By: Ingo
Date Posted: 12 Feb 13 at 10:14AM
Hi Ann!
 
That's not possible with QuickPDF-functionality:
http://www.quickpdflibrary.com/faq/verify-a-signature.php - http://www.quickpdflibrary.com/faq/verify-a-signature.php
What i can imagine is ...
Read the complete pdf-content into a string and check for
special tags having to do with signatures.
Before you should have a look (with notepad) into a pdf
without and with signature to see the differences.
Only an idea ... perhaps it works ;-)
 
Cheers and welcome here,
Ingo
 


Posted By: AndrewC
Date Posted: 18 Feb 13 at 7:10AM

You may want to try the following code

            bool hasSig = false;
            for (int i = 1; i <= QP.FormFieldCount(); i++)
                if (QP.GetFormFieldType(i) == 6)     // FormFieldType = Signature
                    hasSig = true;



Posted By: Ingo
Date Posted: 18 Feb 13 at 1:41PM
Good to know.
Should be something for the guides or samples?
Nobody will have the idea to check the formfield-types ;-)
 
Cheers, Ingo



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk