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.

Sat May 02, 2020 5:35 pm

Hello good afternoon!
I am digitally signing a PDF document with the API.
There is a parameter called LTV that is always disabled when signing with the API.
If I sign digitally with Adobe Reader, LTV is enabled.
With the API can I work with this parameter?

My Code:
Dim doc As PdfDocument = New PdfDocument("Doc.pdf")
Dim page As PdfPageBase = doc.Pages(0)
Dim cert As PdfCertificate = New PdfCertificate("cert.pfx", "xxxxxx")
Dim signature As PdfSignature = New PdfSignature(doc, page, cert, cert.FriendlyName)
signature.Certificated = True
signature.DocumentPermissions = PdfCertificationFlags.ForbidChanges
doc.SaveToFile(IO.Path.GetDirectoryName("Doc_Sign.pdf")

Thank you for your attention

gafforelli
 
Posts: 37
Joined: Sat Sep 15, 2018 6:38 pm

Mon May 04, 2020 3:09 am

Hello,

Thanks for your inquiry.
Please refer to the following code and download the latest Spire.PDF Pack(Hot Fix) Version:6.4.11 for testing. If there is any question, please get back to us.
Code: Select all
        Dim doc As New PdfDocument()
        doc.LoadFromFile("Doc.pdf")
        Dim page As PdfPageBase = doc.Pages(0)
        Dim pfxPath As String = inputfile
        Dim cer As New PdfCertificate(pfxPath, "xxxx", X509KeyStorageFlags.Exportable)

        'Add a signature to the specified position
        Dim signature As New PdfSignature(doc, page, cer, "signature")
        signature.Bounds = New RectangleF(New PointF(90, 550), New SizeF(180, 90))

        'Configure OCSP which must conform to RFC 2560
        signature.ConfigureHttpOCSP(Nothing, Nothing)

        signature.Certificated = True
        signature.DocumentPermissions = PdfCertificationFlags.ForbidChanges

        'Save the PDF file
        Dim outputFile As String = "result.pdf"
        doc.SaveToFile(outputFile, FileFormat.PDF)


Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Mon May 04, 2020 4:22 am

Hi Rachel.
Thanks for the quick return.
I applied the code sample but still does not activate LTV.
I'm using the version of api 6.4.11 that you recommended.
What else can I do from here to help you with testing?
Thanks in advance.

gafforelli
 
Posts: 37
Joined: Sat Sep 15, 2018 6:38 pm

Mon May 04, 2020 6:48 am

Hello,

Thanks for your prompt response.
To help us further look into your issue, please provide the following information.
1) Your input file, your certificate and password, and along with your output file.
2) Your Adobe version information (E.g Adobe Acrobat Reader DC version 2020.006.20042).
3) Your environment information, such as OS information (E.g. Windows 7, 64bit) and Region setting (E.g. China, Chinese).
You could sent them to us([email protected]) via email. Don’t worry, we promise to keep your files confidential and we will not use it for any other purpose. Thanks in advance.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Fri May 15, 2020 12:40 am

Hello Rachel, good night.
I think the problem was with the certificate. The same was expired.
We will proceed with the renewal of it and test again.
Thank you very much for your attention.

gafforelli
 
Posts: 37
Joined: Sat Sep 15, 2018 6:38 pm

Fri May 15, 2020 1:11 am

Hello,

Thanks for your feedback.
If encounter any other questions during the test, just feel free to let us know.
Wish you all the best!

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.PDF