We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Word for Java - sign PDF using CAC Card

We are using Aspose.Word for Java to generate PDF documents from our J2EE application. As a next step in our process, we need the ability to sign those PDFs using CAC Card. Does Aspose.Word have that capability ? If it does, can you share some write-up and samples on that.

Hi Naresh,


Thanks for your inquiry. Please use PdfSaveOptions.setDigitalSignatureDetails method to set the details for signing the output PDF document. Please read the detail of PdfDigitalSignatureDetails class from here:
http://www.aspose.com/docs/display/wordsjava/com.aspose.words.PdfDigitalSignatureDetails+class

Following code example shows how to digital sign a PDF document.

PdfDigitalSignatureDetails signatureDetails = new PdfDigitalSignatureDetails(MyDir + “cert.p12”,“testpdf”, “Test Signing”, “Aspose Office”, new java.util.Date());<o:p></o:p>

Document doc = new Document();<o:p></o:p>

PdfSaveOptions saveOptions = new PdfSaveOptions();<o:p></o:p>

saveOptions.setDigitalSignatureDetails(signatureDetails);<o:p></o:p>

doc.save(MyDir + “Out.pdf”, saveOptions);<o:p></o:p>


I hope, this helps.

Best regards,