Unplanned
Last Updated: 06 Feb 2024 14:40 by John
John
Created on: 06 Feb 2024 14:40
Category: PdfProcessing
Type: Bug Report
0
PdfProcessing: Newly created SignatureDataProperties object misses Contents initialization
Sign a random pdf document with the following code. If UseSignatureProperties=1, the produced PDF document will be corrupted and Adobe displays an error message when opening the file: 
        Dim signProp As New SignatureDataProperties
        signProp.ContactInfo = strContactInfo
        signProp.Name = strSignersName
        signProp.Reason = strReason
        signProp.Location = strLocation
        signProp.TimeOfSigning = DateTime.Now

        Dim signatureName As String = "EsignSignature"

        Dim signatureField1 As SignatureField = New SignatureField(signatureName)
        UseSignatureProperties = 1

        If UseSignatureProperties = 1 Then
            Dim sign1 = New Signature(certificate)
            signatureField1.Signature = sign1
            signatureField1.Signature.Properties = signProp 'THIS WOULD FAIL
        Else
            signatureField1.Signature = New Signature(certificate)
            signatureField1.Signature.Properties.ContactInfo = strContactInfo
            signatureField1.Signature.Properties.Location = strLocation
            signatureField1.Signature.Properties.Name = strSignersName
            signatureField1.Signature.Properties.Reason = strReason
            signatureField1.Signature.Properties.TimeOfSigning = DateTime.Now  'THIS WORKS
        End If
0 comments