Ridey
Ridey

Reputation: 11

api function not working in vbscript

I am using an activex control in an html file that captures signature from a signature pad(ePad-i.d pro). In the html page, vbscript is being used. In the provided api, there is a function that can be used to save the signature as an image file. Here is the description for that function:

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

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

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

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

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

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

6.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.

So, I am creating a subroutine in vbscript that calls this function like this:

sub SaveToFile()
  window.document.IntegriSign1.SaveToFile("C:\SignCaptureData",200,150,0) 
end sub

But this doesn't do anything. Thanks for the help in advance.

Upvotes: 1

Views: 228

Answers (1)

Ekkehard.Horner
Ekkehard.Horner

Reputation: 38765

Your

 window.document.IntegriSign1.SaveToFile("C:\SignCaptureData",200,150,0) 

tries to call the method .SaveToFile with four parameters. In VBscript you are not allowed to use param list () when calling a Sub (cf. here).

So try

window.document.IntegriSign1.SaveToFile "C:\SignCaptureData", 200, 150, 0 

That you didn't mention an error (message) indicates that you have disabled error reporting by some IE config parameter or by using "On Error Resume Next". Please make sure that errors are reported - at least as long as your script 'does not work'.

Upvotes: 1

Related Questions