Page 1 of 1

Web Scanning properties at client side JavaScript

Posted: Wed Aug 11, 2021 12:18 pm
by SMOsama
I am using JavaScript and ASP.NET MVC for using GdPicture14.WEB.DocuVieware. I will have textbox where user will enter brightness and contrast values and after that user will upload image, PDF or use TwainAcquireToNewDocument to upload and that user entered values of brightness and contrast should apply to that uploaded file. How can I achieve this in JavaScript. I have gone through documentation but cannot find it in DocuViewareAPI. Yes, this functionality is in gdpictureImaging but I how can I use this in JavaScript client side.

One more question over here is what is difference between SetBrightness and TwainSetBrightness because at server side I was calling TwainSetBrightness and to do that I read from documentation that the result of TwainGetState() should be 4 i.e SOURCE_OPEN but when I called TwainGetState() it gives 3 i.e TWAIN_SM_OPEN. How can I do it to 4. In windows form application we can use _oGdPictureImaging.TwainSelectSource(IntPtr.Handle) and after that we can have 4 i.e SOURCE_OPEN. But we cannot have IntPtr.Handle in asp.net mvc or in JavaScript. So, how to move state to 4 to use TwainSetBrightness.

I am using almost latest DLL's
GdPicture.NET.14.WEB.DocuVieware.dll

GdPicture.NET.14.filters.64.dll
GdPicture.NET.14.image.gdimgplug.64.dll
GdPicture.NET.14.Imaging.Rendering.Skia.64.dll

I have attached files, these are not executable but surely you can get the idea what I have done until now.

Re: Web Scanning properties at client side JavaScript

Posted: Thu Aug 12, 2021 2:45 pm
by Fabio
Hello there,

If I understand well your requirement, you can simply call a PostCustomServerAction and send the brightness/contrast values to the server to apply the modifications. All the heavy processes (OCR, image manipulation, conversion, etc..) are always loaded on the server-side with DocuVieware since we want to provide zero footprints to the client. So you will not be able to directly change these parameters by the JS itself.
Do not hesitate to elaborate on it if I missed something.

The difference between the SetBrightness and TWAINSetBrightness methods is if you want to set the brightness at the image acquisition or directly in an existing image.
In order to avoid any old issue that was resolved, could you update the DocuVieware SDK on your machine and change the DLLs/min-js/min-css and test it again, please?
If the issue still occurs, please, could you provide a minimalistic sample that reproduces it?

With best,
Fabio

Re: Web Scanning properties at client side JavaScript

Posted: Wed Aug 18, 2021 9:40 am
by SMOsama
Sorry for late reply. I have used TwainCapabilities for client side and it is working fine for me. Thanks for your reply.

Re: Web Scanning properties at client side JavaScript

Posted: Thu Feb 02, 2023 3:55 am
by superedan
The interpreter's inability to distinguish between the trusted code the developer intended and the injected code the attacker supplied as an input results in the security vulnerability.
1v1 lol

Re: Web Scanning properties at client side JavaScript

Posted: Fri Mar 17, 2023 3:44 am
by tonyadams
So as to apply the user-entered brightness and contrast values to an uploaded image or PDF, you can use the GdPicture14 JavaScript API provided by DocuVieware. Specifically, io games you can use the `ApplyEffect` method of the `DocuVieware` object to apply the desired effects to the currently displayed document.

Re: Web Scanning properties at client side JavaScript

Posted: Fri Mar 17, 2023 3:57 am
by visaroe
The source code for the executable that hosts the scanning service is given so that you may add additional libraries as required, brand the EXEcoreball as needed, and package the executable using your preferred packaging tools.