"Invalid Characters into the path"

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

Moderator: Alex

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

"Invalid Characters into the path"

Post by mywebforall »

Hi Alex,

thank to you i managed to make the Web Scanning working, but when i call the acquiredImages.saveImages() method to save the file, i get an alert "Invalid Characters into the path". Honestly i don't understand to which characters is the alert referring.
Here is a part of the code with the method i call :

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);
                    // save acquired image to "result.pdf" file
                    console.log(acquiredImage);
                    acquiredImages.saveImages("C:\\Users\luigi\Desktop\PDF\result"+savedImageCount+".pdf", false, [ acquiredImage.get_Id() ]);
                    savedImageCount = savedImageCount + 1;
                    break;
                case 4:   // scan is failed
                    alert(acquireModalResult.get_ErrorMessage());
                    break;
                case 9:   // scan is finished
                    break;
            }
Best regards,
Luigi
Alex
Site Admin
Posts: 2305
Joined: Thu Jul 10, 2008 2:21 pm

Re: "Invalid Characters into the path"

Post by Alex »

Hi Luigi,

You have wrong file path in JavaScript code.

Here is path in your code: "C:\\Users\luigi\Desktop\PDF\result"+savedImageCount+".pdf"

Here is correct path: "C:\\Users\\luigi\\Desktop\\PDF\\result"+savedImageCount+".pdf"

Best regards, Alexander
mywebforall
Posts: 15
Joined: Wed Mar 01, 2023 2:35 pm

Re: "Invalid Characters into the path"

Post by mywebforall »

Got it, thank you!
Best regards,
Luigi
Post Reply