Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Wed May 11, 2022 1:04 am

Hello!

I'm thinking about buying Spire PDF for Java but before that I'm using the free 5.1.0 version to see how works, then the following happened:

I followed steps from the e-iceblue guide and everything seemed to work wonderfully right, the PDF was "visually" signed, but then trying to validate the PDF in Adobe Reader I got a few errors, you can see it in SS1:

SS1.png


In addition to it, when I click in "Certificate Details" , nothing happens, while it works fine when I use the same certificate but another lib for pdf sign (like aspose)

I could not found any reason to justify errors in formatting, but exploring the lib methods I found something that seemed oddly to me, it does look like a encoding problem, you can see it in SS2:

SS2.png


The same occurs even with the 5.4.2 evaluation version.

Would like to know what you guys can tell me about it, will be glad for any help.

My code:

Code: Select all
byte[] bytes = //Receive a PDF
PdfDocument doc = new PdfDocument();
doc.loadFromBytes(bytes);
PdfCertificate certificado = new PdfCertificate("certificate.pfx", "password");
PdfSignature signature = new PdfSignature(doc, doc.getPages().get(0), certificado, "Jones");
Rectangle2D rect = new Rectangle2D.Float();
rect.setFrame(new Point2D.Float(new Float(10.00), new Float(10.00)), new Dimension(600, 50));
signature.setBounds(rect);
signature.setGraphicMode(GraphicMode.Sign_Detail);
signature.setNameLabel("Signer:");
signature.setName("Gary");
signature.setContactInfoLabel("ContactInfo:");
signature.setContactInfo("02881705109");
signature.setLocationInfoLabel("Location:");
signature.setLocationInfo("Brazil");
signature.setReasonLabel("Reason: ");
signature.setReason("The certificate of this document");
signature.setDateLabel("Date");
signature.setDate(new java.util.Date());
signature.setSignDetailsFont(new PdfFont(PdfFontFamily.Helvetica, 10f, PdfFontStyle.Regular));
signature.setDocumentPermissions(PdfCertificationFlags.Forbid_Changes);
signature.setCertificated(true);
doc.saveToFile("test.pdf");
doc.close();

gernansoares
 
Posts: 3
Joined: Tue May 10, 2022 6:10 pm

Wed May 11, 2022 10:30 am

Hello,

Thanks for your inquiry.

Regarding SS1, to help us reproduce the issue, could to please provide your test certificate file and its password? You can share it with us via emial(support@e-iceblue.com). Thank you in advance.

Regarding SS2, it's not encoding problem. It's just a result of code obfuscation.
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Thu May 12, 2022 3:40 am

Hi

Thank you for your help, sent you all the information you requested (and a little more).

gernansoares
 
Posts: 3
Joined: Tue May 10, 2022 6:10 pm

Thu May 12, 2022 6:19 am

Hi,

Thanks for your sharing. We have received the email.

As you mentioned, I do get the error when verifing the signature after signing with this certificate using spire.pdf. I have logged this issue in our bug tracking system with the ticket SPIREPDF-5182. We will investigate and fix the issue. I wiil get back to you as soon as there is any progress about it.
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Thu May 12, 2022 1:10 pm

Hello!

Thank you so very much for your time, is there anyway I can track about the fix?

gernansoares
 
Posts: 3
Joined: Tue May 10, 2022 6:10 pm

Fri May 13, 2022 3:04 am

Hello,

I'm sorry that the tracking system is not open to the public. We will keep you informed via email or forum when there is any new progress on this issue.
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Return to Spire.PDF