如何从浏览器触发扫描器?

时间:2021-12-27 04:14:34

I have Fujitsu fi-6130 TWAIN / ISIS scanners that I'd like to trigger from a button in a jQuery Rails web page. Not only would I like to have the page tell the scanner to "go", I'd also like to upload the resulting file via Paperclip once the (single) page is scanned - ideally without requiring the user to navigate a file explorer widget to find the file manually.

我有Fujitsu fi-6130 TWAIN / ISIS扫描仪,我想从jQuery Rails web页面的一个按钮触发。我不仅想让页面告诉扫描器“go”,还想在扫描(单个)页面后通过Paperclip上传结果文件——理想情况下,不需要用户导航file explorer小部件来手动查找文件。

Each scanner is usb attached to a Windows XP desktop, though we may replace these call center desktops with Google Chrome OS.

每个扫描器都是usb连接到Windows XP桌面,尽管我们可以用谷歌Chrome OS替换这些呼叫中心桌面。

This question was asked almost a year ago, but mainly received suggestions requiring the use of commercial IE .NET products that cost several hundred dollars - Interfacing with the end-user's scanner from a webapp (web/scanner integration)

这个问题在大约一年前就被提出来了,但主要是收到了一些建议,要求使用花费几百美元的商业IE。net产品——与最终用户的扫描器通过webapp (web/扫描器集成)进行交互

5 个解决方案

#1


13  

This isn't possible from directly within a standard HTML/js page - js has no permissions to access peripherals like scanners.

这在标准的HTML/js页面中是不可能实现的——js没有访问外围设备(比如扫描仪)的权限。

It may well be possible using either flash or silverlight but suspect you'd hit permissions issues. There's articles here and here but it may be a) too involved and b) not quite what you're after.

使用flash或silverlight都是可能的,但您可能会遇到权限问题。这里和这里都有文章,但可能是a)太复杂了b)不是你想要的。

If you control the machines the web app will be running on, I'd recommend using a simple desktop client to perform the scan and allowing connections to it from within the webpage by opening up a local port

如果您控制了web应用程序将要运行的机器,我建议使用一个简单的桌面客户端来执行扫描,并通过打开一个本地端口允许从网页内部连接到它

so js does an AJAX call to (say) http://localhost:1234/Services/Scan which returns an image

所以js对http://localhost:1234/Services/Scan进行AJAX调用,该调用返回一个图像

Edit: With regards to writing the desktop client, you've got a number of options. I'd personally recommend you not try to do this in PERL/PHP as they don't seem to be the right tool for the job and I suspect you'll end up loading COM objects to try and access TWAIN devices (and we all know how much fun that is...)

编辑:关于编写桌面客户端,您有许多选项。我个人建议您不要在PERL/PHP中尝试这样做,因为它们似乎不是工作的合适工具,我怀疑您最终会加载COM对象来尝试访问TWAIN设备(我们都知道这是多么有趣的事情)。

In the comments, you've indicated you don't like Visual Studio - So if you're familiar with Java, I'd suggest you have a look at JTwain (commercial but seems to be good quality) or start reading here. NB: I'm not a frequent java developer so can't guarantee either of the above is exactly what you need.

在评论中,您表示不喜欢Visual Studio——因此,如果您熟悉Java,我建议您看看JTwain(商业的,但质量似乎不错),或者在这里开始阅读。NB:我不是一个经常使用java的开发人员,所以不能保证以上任何一种都是您所需要的。

Beyond that, I'd suggest C++ using a different IDE (although this wouldn't be OS-agnostic)

除此之外,我建议使用不同的IDE(尽管这不是os不可知论的)c++

#2


11  

There is a solution called Dynamic Web TWAIN from Dynamsoft which provides a Browser-based TWAIN SDK for acquiring images from TWAIN devices, and editing and saving them to remote databases.

Dynamsoft有一个名为Dynamic Web TWAIN的解决方案,它提供了一个基于浏览器的TWAIN SDK,用于从TWAIN设备中获取图像,并编辑并保存到远程数据库中。

#3


2  

As @Basic mentioned, JTwain can be used to create such a solution. In fact, the developer of JTwain has created ScannerJS that allows one to scan directly from browsers like IE, Chrome and Firefox using JavaScript. In order to use it in your web pages, you need:

正如@Basic提到的,可以使用JTwain来创建这样的解决方案。实际上,JTwain的开发人员已经创建了ScannerJS,它允许用户使用JavaScript直接从IE、Chrome和Firefox等浏览器进行扫描。为了在你的网页上使用它,你需要:

Include scanner.js:

包括scanner.js:

<html lang="en"><head>
<script src="//asprise.azureedge.net/scannerjs/scanner.js" type="text/javascript"></script>

and call scanner.scan:

并调用scanner.scan:

function scanToWebPageAndUploadToWebServer() {
   scanner.scan(displayImagesOnPage,
{
"twain_cap_setting": {
    "ICAP_PIXELTYPE": "TWPT_GRAY",
    "ICAP_XRESOLUTION": "200",
    "ICAP_YRESOLUTION": "200"
},
"prompt_scan_more": true,
"discard_blank_pages": "false",
"blank_page_threshold": "0.02",
"output_settings": [
    {
        "type": "return-base64-thumbnail",
        "format": "jpg",
        "thumbnail_height": 200
    },
    {
        "type": "upload",
        "format": "pdf",
        "pdf_force_black_white": "false",
        "pdfa_compliant": "false",
        "pdf_text_line": "By ${USERNAME} on ${DATETIME}",
        "exif": {
            "DocumentName": "Doc Scan Powered by Asprise.com",
            "UserComment": "Scanned using Asprise software"
        },
        "upload_target": {
            "url": "https://asprise.com/scan/applet/upload.php?action=dump",
            "max_retries": 2,
            "post_fields": {
                "provider": "Asprise"
            },
            "cookies": "name=Asprise; domain=asprise.com",
            "auth": "user:pass",
            "headers": [
                "Referer: http://asprise.com"
            ],
            "log_file": "null",
            "max_operation_time": 600
        }
    }
]
}

    );
    }

#4


1  

You can use a signed applet, using a library like MMS computing's. You can see it in use in an applet in the codebase of OpenKM.

您可以使用签名的applet,使用像MMS计算这样的库。您可以在OpenKM的代码基中的applet中看到它的使用。

#5


1  

It seems there's a Web API toolkit available for Fujitsu fi series scanners. Its basically an app you install on client machine where the scanner is that accepts calls via JSON or Silverlight and sends them to the scanner drivers.

似乎有一个用于Fujitsu fi系列扫描仪的Web API工具包。它基本上是你在客户端机器上安装的一个应用程序,扫描器通过JSON或Silverlight接收调用并将它们发送给扫描器驱动程序。

http://uk.emc.com/enterprise-content-management/captiva/cloud-toolkit.htm

http://uk.emc.com/enterprise-content-management/captiva/cloud-toolkit.htm

I've just downloaded it and am reading trough the docs, so can't vouch it works.

我刚刚下载了它,正在阅读文档,所以不能保证它能正常工作。

#1


13  

This isn't possible from directly within a standard HTML/js page - js has no permissions to access peripherals like scanners.

这在标准的HTML/js页面中是不可能实现的——js没有访问外围设备(比如扫描仪)的权限。

It may well be possible using either flash or silverlight but suspect you'd hit permissions issues. There's articles here and here but it may be a) too involved and b) not quite what you're after.

使用flash或silverlight都是可能的,但您可能会遇到权限问题。这里和这里都有文章,但可能是a)太复杂了b)不是你想要的。

If you control the machines the web app will be running on, I'd recommend using a simple desktop client to perform the scan and allowing connections to it from within the webpage by opening up a local port

如果您控制了web应用程序将要运行的机器,我建议使用一个简单的桌面客户端来执行扫描,并通过打开一个本地端口允许从网页内部连接到它

so js does an AJAX call to (say) http://localhost:1234/Services/Scan which returns an image

所以js对http://localhost:1234/Services/Scan进行AJAX调用,该调用返回一个图像

Edit: With regards to writing the desktop client, you've got a number of options. I'd personally recommend you not try to do this in PERL/PHP as they don't seem to be the right tool for the job and I suspect you'll end up loading COM objects to try and access TWAIN devices (and we all know how much fun that is...)

编辑:关于编写桌面客户端,您有许多选项。我个人建议您不要在PERL/PHP中尝试这样做,因为它们似乎不是工作的合适工具,我怀疑您最终会加载COM对象来尝试访问TWAIN设备(我们都知道这是多么有趣的事情)。

In the comments, you've indicated you don't like Visual Studio - So if you're familiar with Java, I'd suggest you have a look at JTwain (commercial but seems to be good quality) or start reading here. NB: I'm not a frequent java developer so can't guarantee either of the above is exactly what you need.

在评论中,您表示不喜欢Visual Studio——因此,如果您熟悉Java,我建议您看看JTwain(商业的,但质量似乎不错),或者在这里开始阅读。NB:我不是一个经常使用java的开发人员,所以不能保证以上任何一种都是您所需要的。

Beyond that, I'd suggest C++ using a different IDE (although this wouldn't be OS-agnostic)

除此之外,我建议使用不同的IDE(尽管这不是os不可知论的)c++

#2


11  

There is a solution called Dynamic Web TWAIN from Dynamsoft which provides a Browser-based TWAIN SDK for acquiring images from TWAIN devices, and editing and saving them to remote databases.

Dynamsoft有一个名为Dynamic Web TWAIN的解决方案,它提供了一个基于浏览器的TWAIN SDK,用于从TWAIN设备中获取图像,并编辑并保存到远程数据库中。

#3


2  

As @Basic mentioned, JTwain can be used to create such a solution. In fact, the developer of JTwain has created ScannerJS that allows one to scan directly from browsers like IE, Chrome and Firefox using JavaScript. In order to use it in your web pages, you need:

正如@Basic提到的,可以使用JTwain来创建这样的解决方案。实际上,JTwain的开发人员已经创建了ScannerJS,它允许用户使用JavaScript直接从IE、Chrome和Firefox等浏览器进行扫描。为了在你的网页上使用它,你需要:

Include scanner.js:

包括scanner.js:

<html lang="en"><head>
<script src="//asprise.azureedge.net/scannerjs/scanner.js" type="text/javascript"></script>

and call scanner.scan:

并调用scanner.scan:

function scanToWebPageAndUploadToWebServer() {
   scanner.scan(displayImagesOnPage,
{
"twain_cap_setting": {
    "ICAP_PIXELTYPE": "TWPT_GRAY",
    "ICAP_XRESOLUTION": "200",
    "ICAP_YRESOLUTION": "200"
},
"prompt_scan_more": true,
"discard_blank_pages": "false",
"blank_page_threshold": "0.02",
"output_settings": [
    {
        "type": "return-base64-thumbnail",
        "format": "jpg",
        "thumbnail_height": 200
    },
    {
        "type": "upload",
        "format": "pdf",
        "pdf_force_black_white": "false",
        "pdfa_compliant": "false",
        "pdf_text_line": "By ${USERNAME} on ${DATETIME}",
        "exif": {
            "DocumentName": "Doc Scan Powered by Asprise.com",
            "UserComment": "Scanned using Asprise software"
        },
        "upload_target": {
            "url": "https://asprise.com/scan/applet/upload.php?action=dump",
            "max_retries": 2,
            "post_fields": {
                "provider": "Asprise"
            },
            "cookies": "name=Asprise; domain=asprise.com",
            "auth": "user:pass",
            "headers": [
                "Referer: http://asprise.com"
            ],
            "log_file": "null",
            "max_operation_time": 600
        }
    }
]
}

    );
    }

#4


1  

You can use a signed applet, using a library like MMS computing's. You can see it in use in an applet in the codebase of OpenKM.

您可以使用签名的applet,使用像MMS计算这样的库。您可以在OpenKM的代码基中的applet中看到它的使用。

#5


1  

It seems there's a Web API toolkit available for Fujitsu fi series scanners. Its basically an app you install on client machine where the scanner is that accepts calls via JSON or Silverlight and sends them to the scanner drivers.

似乎有一个用于Fujitsu fi系列扫描仪的Web API工具包。它基本上是你在客户端机器上安装的一个应用程序,扫描器通过JSON或Silverlight接收调用并将它们发送给扫描器驱动程序。

http://uk.emc.com/enterprise-content-management/captiva/cloud-toolkit.htm

http://uk.emc.com/enterprise-content-management/captiva/cloud-toolkit.htm

I've just downloaded it and am reading trough the docs, so can't vouch it works.

我刚刚下载了它,正在阅读文档,所以不能保证它能正常工作。