Convert Topaz Sigweb sigstring to Base64

前端 未结 3 1712
春和景丽
春和景丽 2021-02-08 23:15

I am working on a mobile application(ionic) where there is a field for user\'s signature. Users needs to sign with their finger in canvas.

Now this application has web v

3条回答
  •  时光说笑
    2021-02-08 23:59

    The SigWeb SDK provides a method to get the signature string in a image format. Using that image, its possible to generate the target Base64 string. Here's a vb.net based implementation.

     Dim sigImage As System.Drawing.Image
     Dim sigObj As Topaz.SigPlusNET
     sigObj = New Topaz.SigPlusNET
     sigObj.SetSigCompressionMode(1)
    
     sigObj.SetSigString(sigWebSignatureString)
     sigObj.SetImageFileFormat(2)
     sigObj.SetImageXSize(100)
     sigObj.SetImageYSize(80)
     sigObj.SetImagePenWidth(1)
     sigObj.SetJustifyMode(5)
     sigImage = sigObj.GetSigImage()
     Using ms As New MemoryStream()
     System.Drawing.Image.Save(ms, Format)
          Dim imageBytes As Byte() = ms.ToArray()
          Dim base64String As String = Convert.ToBase64String(imageBytes)
     End Using
    

提交回复
热议问题