1
votes

I am working with a preexisting Lotus Notes Document, and need to make a way for one to use their touchscreen to sign their name. In other words, an electric ink signature. I read somewhere about a inkpicture control, but have found no other knowledge of this pertaining to Lotus Notes. Finally, I know there is an XPages solution, but I cannot use XPages because the document already exists in the client.

Someone has asked this elsewhere http://newscentral.exsees.com/item/b65fcc97b2e21f6403d53b1b28d5bcd6-10fc39c1fae9c814ab0df96984f3badd but nobody has answered.

Has anyone encountered anything similar? Thank you.

1

1 Answers

0
votes

We have the InkPicture OLE object in our older code. The subform where it resides has these critical warnings:

To prevent from loosing properties on the InkPicture OLE objects, the signatures subform should only be edited on a PC with the Microsoft Tablet PC Platform SDK installed!

Do not remove the space in front of the signature OLE object. Doing so may cause notes to crash depending on which version you are using

EDITED OUT TO add to the form you use Create-Object and select controls. The control is InkPicture. Then we have a button that saves it to a rich Text field:

{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}

This button makes sure the actual image is a reasonable size as he control allows scribbling all over the screen.

Nick Fry helped me with this answer. Hope this helps.