Highlighted
Absent Member.
Absent Member.
1745 views

[archive] Signiture pad in Cobol

[Migrated content. Thread originally posted on 20 April 2009]

We are currently trying to capture a signiture using the epadink form Interlink electronics to capture a signiture. They provide an activex control but I am not sure how to get the signiture into a file or store it. Is anyone using a sig pad that can give me some direction?

The active x control when double clicked will activate the sig pad and I can sign and it shows on the screen in the control but not sure how to get the data from the control. It doesn't seem to have a value field in the property.

activex control name is esW25COM.OCX

Thanks,
0 Likes
11 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Signiture pad in Cobol

Sometimes it can be stored in a file. Do you have any documentation for the control?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Signiture pad in Cobol

I just found the documentation on it and found this section.

Not sure what to do in cobol. The only active x controls I have used are the ones provided by acucobol. If you could help I would appreciate it greatly.

Documentation:

8.1.3 Signing Methods/Functions
8.1.3.8 SaveToFile
Description

Saves the signature as an image file (bmp, jpeg, gif) in the set location.
Parameters

FileName ? Data type String - Complete file Path where the bmp image is to be saved.

nHeight ? Data type Integer - Height of the bmp image in pixels.

nWidth ? Data type Integer - Width of the bmp image in pixels.

FileType - Data type FILETYPE ? Indicates type of file (image) storage.
(BMP = 0, JPEG =1, GIF=2)

ImageQuality ? Data type Integer ? For image quality (jpeg). An Optional
parameter.

GIFTransparency ? Data type Integer ? For Non-transparent GIF the value is 0 and for transparent GIF the value is 1. An Optional parameter.
Note: ImageQuality should be between 0 and 100. If the parameter is not set or is set to zero ImageQuality is taken as 80 by default.

Return Value
This returns nothing.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Signiture pad in Cobol

I'd have to see what AXDEFGEN produced to be completely sure, but in general you would modify your ActiveX control handle like:

MODIFY SigControl @SaveToFile(ws-filename, ws-height, ws-width, ws-type...).

If you have sample VB code, that is always helpful in trying to determine what the COBOL equivalent is as well.

Rob
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Signiture pad in Cobol

* SaveToFile
* Saves the Signature image onto a file
METHOD, 8, @SaveToFile,
"BSTR" @FileName, TYPE 8,
"int" @nWidth, TYPE 22,
"int" @nHeight, TYPE 22,
"FILETYPE" @FILETYPE, TYPE 29,
"int" @ImageQuality, TYPE 22,
"int" @GifTransparency, TYPE 22
OPTIONAL 2

I am looking for the VB code.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Signiture pad in Cobol

The portion of the def file you posted confirms that you would do as I suggested. The SaveToFile method takes 6 parameters, but the last 2 are optional. Filename is a string and Filetype should be defined somewhere else in the def file (the documentation shows values are 0, 1, or 2). The rest are integers.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Signiture pad in Cobol

Have tried all different ways to save image but get no file saved. I get no error on the line so it looks like it is creating the file but no file. I am trying a different method of capturing the signature.

* GetSignData
* Returns the signature data to be stored away
METHOD, 1, @GetSignData
RETURNING "BSTR", TYPE 8

8.1.3.4 GetSignData
Description: This function returns the signature data in an encrypted Base64string Format. If not signed, it returns a null string.

Parameters: This takes no inputs.

Return Value: Signature data in encrypted Base64String format.

I appoligize for my ignorance but can you show me a format for the modify string to capture this data. I get a cobol compile error on everything I try.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Signiture pad in Cobol

In situations like these, I usually get an example from the control vendor and make sure it works first. They are usually in VB of C or something. If you can't get them working, you can usually go to the vendor for support. If you can get them working, then it's just a matter of getting the syntax correct for COBOL.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Signiture pad in Cobol

As to the syntax for the GetSignData method, it should be:

MODIFY Control @GetSignData() RETURNING ws-sign-data.

ws-sign-data should be an alphanumeric field.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Signiture pad in Cobol

Thanks that worked. I did not put the () behind the @GetSignData. I guess they are required even if you don't have input variables.

I did reques VB script from the vendor 2 days ago and still waiting for a reply. When I get it I will be able to play around with other options.

Thanks again,
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Signiture pad in Cobol

Thought I had this working but can't figure out how to use the Base64 data string that is created by the signature so I have gone back to trying to capture the bitmap of the sig. Here is my code and I get no error running it, it just doesn't creat the file. Other 3 lines do what they are supose to.

modify Screen1-Es-1 @GetSignData() RETURNING ws-esign-data.
modify Screen1-Ef-1, Value = ws-esign-data.
modify Screen1-Es-1 @SaveToFile("esign", 10, 10, 1, 0).
modify Screen1-Es-1 @ShowDetails()

On the SaveToFile line I have tried using paths and no paths and extension for the name. The next 2 fields is the size of the file and the forth is 0-bitmap, 1-jpeg, 2-gif, and the last field 0 is default for image quality.

Anyone have an idea why it isn't saving the file?
I have tried running it locally on my windows system and running it in ThinClient.

Thanks,
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Signiture pad in Cobol

All looks good to me except I would probably use a full pathname and extension for clarity. Make sure you have permission to write the file to that location? Maybe try to save it as a bmp or other?
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.