[Pas2js] important web assembly question
Michael Van Canneyt
michael at freepascal.org
Mon Aug 12 09:10:57 CEST 2024
On Sun, 11 Aug 2024, Mgr. Janusz Chmiel via Pas2js wrote:
>
> Dear elite Pascal developers here,
>
> Please, could someone tell Me, if WEB assembly allow programmer to develop module, which will be able to use Microsoft object libraryes such as WIA to access USB scanner?
No.
Webassembly relies on the host environment to access all kinds of things.
That means it can only access what the hosting environment offers.
For WebAssembly in the browser, that means the browser APIs.
Consequently Microsoft Object libraries are not accessible.
>
> My goal is to make some simple WEB app which will be capable to scan by using USB compatible WIQA scanner and app would be capable to use UWP API Windows.Media.Ocr to perform OCR on some image file.
> Or unfortunately, such operations are not allowed to do by using WEB assembly for security reasons?
Correct, the security model of the browser does not allow this.
> I Am afraid that it will not be possible to control USB scanner directly from The Javascript level by using Pas2JS.
Pas2js offers you access to all the browser APIs.
For obvious reasons, it cannot offer you more than what the browser itself offers.
The Chrome browser has some experimental USB APIs which can conceivably be
used, but I would not recommend using them, they are not standard at all.
Michael.
More information about the Pas2js
mailing list