Lotus Notes墨迹签名

时间:2015-04-11 15:25:59

标签: .net lotus-notes electronic-signature

我正在使用预先存在的Lotus Notes文档,并且需要让一个人使用他们的触摸屏来签名。换句话说,电子墨水签名。我在某处读到了一个关于inkpicture控件的内容,但是没有发现有关Lotus Notes的其他相关知识。最后,我知道有一个XPages解决方案,但我不能使用XPages,因为该文档已经存在于客户端。

有人在其他地方问了这个问题http://newscentral.exsees.com/item/b65fcc97b2e21f6403d53b1b28d5bcd6-10fc39c1fae9c814ab0df96984f3badd 但没有人回答。

有没有人遇到类似的东西?谢谢。

1 个答案:

答案 0 :(得分:0)

我们的旧代码中有InkPicture OLE对象。它所在的子表单有以下严重警告:

  

为了防止丢失InkPicture OLE对象的属性,   签名子表单只能在装有Microsoft的PC上编辑   安装了平板电脑平台SDK!

     

请勿删除签名OLE对象前面的空格。这样做   可能会导致笔记崩溃,具体取决于您使用的版本

已编辑 要添加到表单,请使用“创建对象”并选择控件。控件是InkPicture。然后我们有一个按钮,将其保存到一个富文本字段:

{Sub Click(Source As Button)

Const GIF=2

Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim sig As Variant 
Dim tempfile As String
Dim sig2 As Variant 
Dim tempfile2 As String
Dim picstream As NotesStream
Dim session As New NotesSession 

Dim dtEpoch As New NotesDateTime("1/1/2000 00:00:00")
Dim dtNow As New NotesDateTime(Now)
Dim dtTemp As Variant
Dim Rectangle As Variant

Set uidoc = ws.CurrentDocument

' write the contents of the ink object to a temporary file
Set sig = uidoc.GetObject("SignatureInk1")
Set sig2 = uidoc.GetObject("SignatureInk2")
Set Rectangle = CreateObject("msinkaut.Inkrectangle")

'The rectangle is used to clip the signature if it is too big.
Rectangle.SetRectangle -300,0,2000,8000 
If Not sig Is Nothing Then
    If sig.Ink.Strokes.Count=0 Then     

    Else 
        dtTemp=dtNow.TimeDifference(dtEpoch)
        tempfile = Session.GetEnvironmentString("Directory", True)+"\~1"+dtTemp+".tmp"

        Set picstream = session.CreateStream
        sig.Ink.Strokes.Clip Rectangle
        picstream.Open(tempfile)
        picstream.Write sig.Ink.Save(GIF)
        picstream.Close

        sig.Enabled = False
        sig.Ink.DeleteStrokes sig.Ink.Strokes
        sig.Enabled = True
        sig.InkEnabled = True

        uidoc.GotoField "Signature1"
        uidoc.FieldClear
        uidoc.Import "GIF Image", tempfile

        Kill tempfile
    End If
End If

If Not sig2 Is Nothing Then
    If sig2.Ink.Strokes.Count=0 Then        

    Else 
        dtTemp=dtNow.TimeDifference(dtEpoch)
        tempfile2 = Session.GetEnvironmentString("Directory", True)+"\~2"+dtTemp+".tmp"

        Set picstream = session.CreateStream
        sig2.Ink.Strokes.Clip Rectangle
        picstream.Open(tempfile2)
        picstream.Write sig2.Ink.Save(GIF)
        picstream.Close

        sig2.Enabled = False
        sig2.Ink.DeleteStrokes sig2.Ink.Strokes
        sig2.Enabled = True
        sig2.InkEnabled = True

        uidoc.GotoField "Signature2"
        uidoc.FieldClear
        uidoc.Import "GIF Image", tempfile2

        Kill tempfile2  
    End If
End If

End Sub}

此按钮可确保实际图像的大小合理,因为控制允许在整个屏幕上涂鸦。

Nick Fry帮我解决了这个问题。 希望这会有所帮助。