1

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

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

有没有人遇到过类似的事情?谢谢你。

4

1 回答 1

0

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

为防止丢失 InkPicture OLE 对象的属性,签名子表单只能在安装了 Microsoft Tablet PC Platform SDK 的 PC 上编辑!

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

已编辑以添加到您使用 Create-Object 的表单并选择控件。控件是 InkPicture。然后我们有一个按钮将其保存到富文本字段中:

{子点击(来源为按钮)

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

结束子}

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

尼克弗莱帮我回答了这个问题。希望这可以帮助。

于 2015-04-14T17:19:08.117 回答