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 Jun 17, 2026 10:40 am

WE have several PDF files that we want to sign.

Signature works for some PDF files, and not for others.

Same exact code, certificate, appearance... only difference is the PDF file to sign.
No problem could be found in the original file

PDF Source 1.PDF : Original PDF file
PDF Source 1Signed.PDF : PDF file signed (working)
ZBKP.PDF : Original PDF
ZBKP Signed.PDF : PDF file signed (Non working)

regards
Guillaume

GuiPATRY
 
Posts: 37
Joined: Wed Feb 17, 2021 10:18 am

Thu Jun 18, 2026 6:45 am

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
User avatar

amy.zhao
 
Posts: 3043
Joined: Wed Jun 27, 2012 8:50 am

Tue Jun 30, 2026 12:46 pm

sorry for the delay in response.
Due to discussion with legal team in some of the countries we manage, the signing project is currently stopped.
If the problem re-occurs, I'll check with you.

GuiPATRY
 
Posts: 37
Joined: Wed Feb 17, 2021 10:18 am

Wed Jul 01, 2026 1:58 am

Hello,

Thank you for your feedback.
If you have any questions or need further assistance, please don't hesitate to let us know. Hope all is well on your end.
Sincerely,
Talia
E-iceblue support team
User avatar

talia.liu
 
Posts: 341
Joined: Mon Apr 14, 2025 3:33 am

Return to Spire.PDF

cron