Hi!
Hi Johannes,
Hi!
Hi Johannes,
Hi Team!
Hi Johannes,
Hi, i have sent you an E-Mail with the sensitive data because i was unable to select "Keep this post private"
Hi Johannes,
Hello!
Hi,
Hi, I am facing the same problem and I do not know waht to do because convert PDF to PDFA is mandatory before signing it and always I try two sign it for the second time the first signature got invalid.
Hi Andre,
// path to digital signature<o:p></o:p>
string pbxFile = "c:/pdftest/MySPC.pfx";
string inFile = @"c:/pdftest/99180_d8390159-b0f0-45c8-bdff-683472a31cc1.pdf";
// load input PDF file
Document doc = new Document(inFile);
// convert document to PDF/A compliacne format
doc.Convert(new MemoryStream(), PdfFormat.PDF_A_1B, ConvertErrorAction.Delete);
// save PDF/A output
doc.Save("c:/pdftest/ConvertedPDF_A_1b.pdf");
string outFile = @"c:/pdftest/99180_d8390159-b0f0-45c8-bdff-683472a31cc1_DigitallySign_out.pdf";
using (Document document = new Document("c:/pdftest/ConvertedPDF_A_1b.pdf"))
{
using (PdfFileSignature signature = new PdfFileSignature(document))
{
Aspose.Pdf.Forms.PKCS7 pkcs = new Aspose.Pdf.Forms.PKCS7(pbxFile, "test"); // Use PKCS7/PKCS7Detached objects
Aspose.Pdf.Forms.DocMDPSignature docMdpSignature = new Aspose.Pdf.Forms.DocMDPSignature(pkcs, Aspose.Pdf.Forms.DocMDPAccessPermissions.FillingInForms);
System.Drawing.Rectangle rect = new System.Drawing.Rectangle(100, 100, 200, 100);
// Set signature appearance
signature.SignatureAppearance = @"c:/pdftest/Conversion.PNG";
// Create any of the three signature types
signature.Certify(1, "Signature Reason", "Contact", "Location", true, rect, docMdpSignature);
// Save output PDF file
signature.Save(outFile);
}
}
using (Document document = new Document(outFile))
{
using (PdfFileSignature signature = new PdfFileSignature(document))
{
System.Collections.IList sigNames = signature.GetSignNames();
if (sigNames.Count > 0) // Any signatures?
{
if (signature.VerifySigned(sigNames[0] as string)) // Verify first one
{
if (signature.IsCertified) // Certified?
{
if (signature.GetAccessPermissions() == Aspose.Pdf.Forms.DocMDPAccessPermissions.FillingInForms) // Get access permission
{
// Do something
}
}
}
}
}
}
Thanks for your patience.
Our product team has further investigated the earlier logged issue PDFNET-40895, which was related to certifying PDF Document(s). Please note note that this is not the issue/bug related to the Aspose.Pdf API, but you need to add certificate into trusted store. Here you can find more details about setting [signature trust in Adobe Reader](http://blogs.adobe.com/security/2008/08/setting_signature_trust_in_ado_2.html)
.
Please take a look on attached screenshot and file certified2_DOESNTWORK.out.pdf, produced after adding certificate to trust store. As far as other logged issue PDFNET-40288 is concerned, we will let you know, once it is resolved. Please spare us little time.
cert.png (34.6 KB)
certified2_DOESNTWORK.out.pdf (115.7 KB)
We are sorry for the inconvenience.
Hi!
The issue is not resolved yet! - your mixing up things! - Read the thread carefully from the beginning!
And dont get confused by the post of “Jonatas” - he is talking from something different in the end!!
I know i’m unable to a sign a document again or change its content after signing - i am aware of it!!
Thanks for contacting support.
We have again tested the scenario with Aspose.PDF for .NET 18.2 and noticed following:
Before Adding the Certificate to Trust Store:
Both output PDF documents showed invalid certificate prompt in Adobe Reader 9 Pro and Adobe Acrobat Reader DC 2018.011.20038.
After Adding the Certificate to Trust Store:
We added the certificate to trust store in both versions of Adobe Reader and certificate was validated in Adobe Reader 9 Pro - whereas the Adobe Acrobat Reader DC kept showing invalid certificate message. Certificate_Validity.png (71.4 KB)
Furthermore, we have also noticed your comments that you are facing invalid certificate error, only in case when document is in PDF/A format. Standard PDF-15 format document, does not cause any issue at your side. Would you please share the Adobe Reader Version which you are using at your end along with some screenshots showing the certificate validity problem.
We have re-opened the relevant issue, so we will provide these details to the respective team. This would definitely help in investigating the issue.
We are sorry for the inconvenience.
The issues you have found earlier (filed as PDFNET-40288) have been fixed in Aspose.PDF for .NET 21.7.