Hello Guillaume,
Thank you for reaching out to us.
I tested digitally signing the document you provided (ZBKP.PDF) using
Spire.PDF for Java Version 12.6.1 with the code below. The signing process completed successfully, and the resulting document opens perfectly without any issues. I was unable to reproduce the problem you mentioned.
- Code: Select all
PdfDocument doc = new PdfDocument();
doc.loadFromFile(path + "ZBKP.pdf");
PdfPageBase pdfPageBase = doc.getPages().get(0);
PdfCertificate x509 = new PdfCertificate(pfxPath, "e-iceblue");
PdfPKCS7Formatter formatter = new PdfPKCS7Formatter(x509, false);
String timeStampUrl = "https://rfc3161.ai.moda/adobe";
formatter.setTimestampService(new TSAHttpService(timeStampUrl));
formatter.setOCSPService(new OCSPHttpService(null));
PdfOrdinarySignatureMaker signatureMaker = new PdfOrdinarySignatureMaker(doc, formatter);
PdfSignature signature = signatureMaker.getSignature();
signature.setName("E-iceblue");
signature.setContactInfo("028-81705109");
signature.setLocation("ChengDu");
PdfSignatureAppearance appearance = new PdfSignatureAppearance(signature);
appearance.setNameLabel("Signer:");
appearance.setContactInfoLabel("Phone:");
appearance.setLocationLabel("Location:");
appearance.setDateLabel("Date:");
appearance.setGraphicMode(GraphicMode.SignImageAndSignDetail);
appearance.setSignatureImage(PdfImage.fromFile(imageFile));
Rectangle2D rect = new Rectangle2D.Float();
rect.setFrame(new Point2D.Float(30, 30), new Dimension(200, 100));
signatureMaker.makeSignature("Signature", pdfPageBase,
(float) rect.getMinX(), (float) rect.getMinY(),
(float) rect.getWidth(), (float) rect.getHeight(),
appearance);
doc.saveToFile(outputFile);
doc.close();
doc.dispose();
To help us further investigate and resolve this issue, could you please provide the following information?
1.The specific version of Spire.PDF for Java you are currently using.
2.The exact signing code you are using.
Looking forward to your reply so we can provide more accurate support.
Sincerely,
Amy
E-iceblue support team