Combine signed pdf files

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v7)  /  Combine signed pdf files

DynamicPDF CoreSuite for .NET (v7) Forum

 Nov 19 2013 6:12 AM
I need to combine several signed pdf in one pdf.
Adobe provides the solution by generating a Portfilio.
Is there any way to to generate a combine PDF with DynamicPDF?
Thanks
ims
 Nov 19 2013 6:30 AM
Posted by a ceTe Software moderator
Hello,

You can merge the PDF documents to build a final PDF document and add supported contents to it using our DynamicPDF Merger for .NET product. You can refer the documentation on document merge here.

It is not possible to generate a Portfolio using any of our DynamicPDF products.

Thanks,
ceTe Software Support Team.
 Feb 07 2014 8:47 AM
If I combine the documents, the final pdf has severals empty sign field.Is there any way to remove them?
Thanks,
ims
 Feb 10 2014 11:27 AM
Posted by a ceTe Software moderator
Hello,

The existing digital signature will be invalidated once you merge the existing PDF having signature in it. You will need to add new signature to the merged PDF document. Also please note that currently the DynamicPDF Merger API supports adding only one signature to the PDF document.

You can remove the form fields by flattening the PDF using FormFlattening property of the MergeDocument class. You will need to save the flattened PDF into byte array and then edit it using PdfDocument class constructor and create object. Then you can append PdfDocument object to MergeDocument object and add new signature to the PDF. Below is the sample code for it. Please note that flattening the PDF will remove all the form fields along with signature field.
 
            MergeDocument tempDocument = new MergeDocument();
            PdfDocument pdf = new PdfDocument(@"C:\Temp\Signature1.pdf");
            tempDocument.Append(pdf);
            //The below code removes all the form fields and faltten the PDF.
            tempDocument.FormFlattening = FormFlatteningOptions.Default;
            //Draw the PDF into byte array.
            byte[] byteData = tempDocument.Draw();

            //Edit the PDF to add new signature.
            PdfDocument pdfObject = new PdfDocument(byteData);
            MergeDocument finalDocument = new MergeDocument();
            finalDocument.Append(pdfObject);
            //Add new signature field.
            Signature signature = new Signature("SigFieldNew", 10, 10, 250, 100);
            //Below code to add signature field to first page.
            finalDocument.Pages[0].Elements.Add(signature);
            Certificate certificate = new Certificate(@"D:\JohnDoe.pfx", "dynamicpdf");
            finalDocument.Sign("SigFieldNew", certificate);
            //Save the final PDF.
            finalDocument.Draw(@"C:\Temp\Output.pdf");

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 10:11 PM.