"acquiredImages.get_Item is not a function"

Questions, comments and suggestions concerning VintaSoft Twain .NET SDK.

Moderator: Alex

Post Reply
mywebforall
Posts: 15
Joined: Wed Mar 01, 2023 2:35 pm

"acquiredImages.get_Item is not a function"

Post 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
mywebforall
Posts: 15
Joined: Wed Mar 01, 2023 2:35 pm

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

Post 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
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: "acquiredImages.get_Item is not a function"

Post 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
Post Reply