Draw area for digital signature...
Posted: Thu Nov 30, 2017 4:37 pm
I am using the following code to automatically add a digital signature to a file, this all works fine. However what I want to do is allow the user to define an area region on the document as to where they want to place the signature. I was wondering how I would do this?
Thanks
Simon
Code: Select all
Private Sub OneClickDigitalSignature(ByVal Inst As IPXV_Inst, ByVal Doc As IPXV_Document)
Try
Dim docOID As Guid = getActiveDocOID()
Dim nID As Integer = Inst.Str2ID("op.document.addDigitalSignature", False)
Dim Op As IOperation = Inst.CreateOp(nID)
Dim input As ICabNode = Op.Params.Root("Input")
input.Add().v = Doc
Dim options As ICabNode = Op.Params.Root("Options")
options("PageNumber").v = 0
options("Certificate").v = "3F26DA34FB7566A7147897F44BB63A43BDBE9F68"
'options("UseFileCertificate").v = True
' 0 = Unknown
' 1 = Approval Signature
' 2 = Certification signature
' 3 = Timestamp signature
options("DigiSigType").v = 1
'options("FileCertificate").v = "D:\vb.net\PDFTracker\AddDigitalSignature\AddDigitalSignature\AddDigitalSignature\111111.pfx"
'options("CertificatePassword").v = "Dragnetadmin1"
options("AskDestinationFileName").v = False
options("DestinationFileName").v = MISData.Instance.TempDirectory & "\" & docOID.ToString.ToUpper & ".pdf"
' 1 = No changes to the document shall be permitted; any change to the document shall invalidate the signature
' 2 = Permitted changes shall be filling in forms, instantiating page templates, and signing; other changes shall invalidate the signature
' 3 = Permitted changes shall be the same as for 2, as well as annotation creation, deletion, and modification; other changes shall invalidate the signature
options("DocMDP").v = 2
Dim appear As ICabNode = options("SignatureAppearance")
appear("HasTemplate").v = True
' I am the author of this document
' I agree to the specified portions of this document
' I have reviewed this document
' I am approving this document
' I attest to the accuracy and integrity of this document
' I agree to the terms defined by the placement of my signature on this document
appear("Reason").v = "I am professional engineer"
Dim tmplt As ICabNode = appear("Template")
tmplt("GraphicType").v = 2
tmplt("GraphicName").v = "D:\vb.net\PDFTracker\AddDigitalSignature\AddDigitalSignature\AddDigitalSignature\rosette.png"
tmplt("ShowName").v = False
tmplt("ShowDate").v = False
tmplt("ShowLocation").v = False
tmplt("ShowReason").v = False
tmplt("ShowDistinguishedName").v = False
tmplt("ShowLabels").v = False
tmplt("ShowSubjectName").v = False
tmplt("ShowEditorVersion").v = False
Dim timeStamp As ICabNode = options("TimeStamping")
timeStamp("Enabled").v = True
Dim timeStampData As ICabNode = timeStamp("Data")
timeStampData("URL").v = "https://ca.signfiles.com/TSAServer.aspx"
Op.Do()
Catch ex As Exception
MsgBox(convertErr(ex))
End Try
End Sub
Thanks
Simon