Hi everyone,

I want to scan documents using a Twain scanner in PHP. I am working on a Linux platform with PHP, Mysql, Apache web server combination. Can anyone help me in getting started. Reference to any useful links will be of great help.

Keeping fingers crossed for any early help available as it is very urgent.
Thanxs in advance for any help.

    asarkar:

    Not really sure what you are asking?

    Do you mean you want to have a form you create in PHP have a button you click on to activate your scanner?

    Do you mean you want to create a PHP script that will read information from documents that have been scanned?

    I don't really have a clue what it is you are wanting to do.

      TWAIN is a Windows-based scanning system, and it's designed to be run interactively with a user; most TWAIN drivers pop-up dialogue boxes which can't be bypassed programmatically. This precludes using it in a server application.

      I can't see how it's useful to do scanning non-interactively, because someone would still need to load the scanner.

      If you're expecting the scanning to be done client-side, then it doesn't matter what software the user uses, they'll have to scan into a temporary local directory and then use HTTP upload to upload the files.

      Clearly, web applications can't run arbitrary local code on the client.

      Mark

        I have a PHP form with a command button. I want to start scanning a document when the user clicks on the command button. Please keep a note of my operating environment as stated earlier.

          Hi.

          That could - COULD - theoretically work if 2 conditions are met:

          1) The scanner is attached in some way to your webserver (the Linux machine)
          2) You have got commandline scripts that are able to connect to and control the twain driver on the windows machine.

          If both conditions are met I think you can use php's commandline execution functions. (based on my assumption that twain can be controlled via scripting at all - but that is beyond my scope of knowledge, so dont cite me there please )

          But if you try that you've got some severey interactivity, security and function issues that you'll have to solve... well. Buncha work, so to say.

          Don't forget that php is executed on a SERVER and can NOT gain access to resources on a client machine, for the obvious good reasons.

          If you need to get stuff scanned and transferred to a server you need some kind of application running on the client - you can do that with java or (in a windows environment) windows application.

          That is not possible with php however.

          Hope this helps you.

          jakob

            Write a Reply...