Page 1 of 1

"acquiredImages.get_Item is not a function"

Posted: Fri Mar 03, 2023 1:37 pm
by mywebforall
Hi Alex,
sorry to bother you again :cry: .
I get this error while i'm tryng to create the object to send to an ftp server, here is my code:

Code: Select all

switch (acquireModalState) {
                case 2:   // image is acquired
                    // get acquired image
                    var acquiredImage = acquireModalResult.get_AcquiredImage();
                    // add acquired image to the collection of acquired images
                    acquiredImages.add(acquiredImage);
                    
                    console.log(acquiredImages);
                    break;
                case 4:   // scan is failed
                    alert(acquireModalResult.get_ErrorMessage());
                    break;
                case 9:   // scan is finished
                let params = {};
                var imageIds = []
                    // for each acquired image
                    for (var i = 0; i < acquiredImages.get_Count(); i++){
                        // add image identifier to array of image identifiers
                        imageIds.push(acquiredImages.get_Item(i).get_Id());
                    }
                    // save images to an image file and return file data as a Base64 string
                    var imageFileAsBase64String = acquiredImages.getAsBase64String(nome_file+'.pdf', imageIds);
                    params.fileToUpload = imageFileAsBase64String;
Am i doing a mistake i don't catch?
Thank you in advance for your help.
Luigi

Re: "acquiredImages.get_Item is not a function" UPDATE

Posted: Fri Mar 03, 2023 2:04 pm
by mywebforall
Find it!

There is a mistake in your Tutorial section : https://www.vintasoft.com/docs/vstwain ... rver.html .

The function is : *.getItem() , not *get_Item() .

Thank you anyway.
Best Regards,
Luigi

Re: "acquiredImages.get_Item is not a function"

Posted: Fri Mar 03, 2023 2:48 pm
by Alex
Hi Luigi,

Thank you for information and sorry for the bug. We forgot to update article after API changes in VintaSoft TWAIN .NET SDK 14.0. Now article is updated.

Best regards, Alexander