Forums

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Merger for .NET (v5.x)  /  Digital Signatures

Forum Thread - Digital Signatures

 Jul 10 2008 2:32 PM
Is it possbile to use Digital Signatures with Merger? I keep getting an error when compiling that states the type or namespace Certificate and Signature can not be found.
I use the code from the examples with a Merged document that worked with v4.x. Am i missing an assembly or is it not possible to do this?
 Jul 10 2008 3:07 PM
Posted by a ceTe Software moderator
Hello,

You will have to add the import statement for the following namespaces to be able to digitally sign the PDF document:

ceTe.DynamicPDF;
ceTe.DynamicPDF.PageElements.Forms;

You can digitally sign the PDF document using the Merger product without any problem.

Thanks,
ceTe Software Support Team
 Jul 10 2008 3:21 PM
Both of those are included and I get the same error.

Could it be something with the intallation? or going from 4.x to 5.x?
 Jul 10 2008 4:00 PM
Posted by a ceTe Software moderator
Hello,

Can you please let us know the exact error message you are getting? Are you able to run the Digital Signatures sample example included with the evaluation download for v5.0?

Thanks,
ceTe Software Support Team
 Jul 10 2008 4:06 PM
The major errors I recieve are:

'ceTe.DynamicPDF.Merger.MergeDocument' does not contain a definition for 'Sign'
 
The type or namespace name 'Signature' could not be found (are you missing a using directive or an assembly reference?)

 The type or namespace name 'Certificate' could not be found (are you missing a using directive or an assembly reference?)

<code>
MergeDocument document = new MergeDocument(MapPath("PDFForms/SysAuthDD2875.pdf"));

Signature signature = new Signature("SigField", 10, 10, 250, 100);
                                page.Elements.Add(signature);
                                document.Pages.Add(page);

                                Certificate certificate = new Certificate(MapPath("../Data/JohnDoe.pfx"), "dynamicpdf");

                                document.Sign("SigField", certificate);
                                        

                                        // Outputs the DD 2875 to the current web page
                                document.DrawToWeb("FormFiller.pdf");
</code>


 Jul 10 2008 5:37 PM
Posted by a ceTe Software moderator
It almost sounds like your application still has a reference to the version 4.0 dll file.  The "Sign" method is definitely off of the Document object in version 5.0.  Also the "Certificate" object is in the ceTe.DynamicPDF namespace while the "Signature" object is in the ceTe.DynamicPDF.PageElements.Forms namespace.  But all this is new to version 5.0 so if you are getting those three errors it looks like you may need a reference to version 5.0.

Thanks,
ceTe Software Support Team
 Jun 04 2013 4:10 PM
Hi ,

I am looking for an example for Disgital Signature using DynamicMerger. Can anyone explain what exactly Certificate means and how to create the .PFX file.

Is there any other way of Digital Signing instead of creating .pfx file
 Jun 05 2013 7:01 AM
Posted by a ceTe Software moderator
Hello,

You can add digital signature to the already existing PDF document using DynamicPDF Merger product API without any problem. The  .pfx is Personal Information Exchange (PFX) certificate which is required to digitally sign the PDF document.

It is not possible to create .pfx file using our DynamicPDF product API and  you will need to get Digital Certificate in .pfx format from a Certificate Authority.  You will need to use the .pfx file to add the digital signature to the PDF using our DynamicPDF API. Please refer documentation on digital signing and certifying here.

Thanks,
ceTe Software Support Team.
 Jun 10 2013 1:04 PM
Hi,
We have a requirement of validating the didgital signatuer in the PDF file..

We created the digitally signed PDF file ...Can anyone let us know how to re validate that file?
 Jun 10 2013 4:37 PM
Posted by a ceTe Software moderator
Hello,

You would only need to revalidate a digitally signed PDF if you make any modifications to it. Modifying the digitally signed PDF will cause the signature to be invalidated.  In order to revalidate the PDF, you would need to use certificate file (pfx) and sign it again. This process is similar to signing the PDF as discussed above.

Thanks,
ceTe Software Support Team
 Jun 01 2016 1:05 AM
Hi
I have a requirement where digitally signature as well as password protected.  Do I need to write first password protection code first and then digitally signature code.  Because if I do digital signature functionality first and then password protected then digital signature is not valid as there is content change in the PDF happened due to password protection.


Can anyone explain how to do this.

Sudhakar
 Jun 01 2016 10:20 AM
Posted by a ceTe Software moderator
Hello Sudhakar,

If you are setting security and also adding digital signature to the existing PDF then you will need to do both before you draw the PDF. If you are adding signature first and drawing PDF and again merging it for setting security, then it will invalidate the signature. Below is the code sample for adding signature and setting security to the existing PDF using Merger product.

            PdfDocument pdf = new PdfDocument("path for input PDF");
            MergeDocument document = new MergeDocument(pdf);
            Signature signature2 = new Signature("MySigField", 10, 10, 300, 100);
            document.Pages[0].Elements.Add(signature2);
            Certificate certificate2 = new Certificate(@"Path for certificate file", "password");
            document.Sign("MySigField", certificate2);
            //Code for setting security.
            HighSecurity security = new HighSecurity("owner", "user");
            document.Security = security;
            document.Draw("C:/Temp/MyDocument.pdf");

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 10:17 AM.