Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This method returns, if the document has been sucessfully successfully extracted, a unique cryptographic, secure hash of 32 bytes, also referred to as “token”.

...

… whereas “TOKEN” must be replaced by the token returned on document upload and “ISOCODE” must be replaced by the desired display language of the GUI. The user interface is then displayed and the control is given to the user.

...

“language=ISOCODE” is optional, if it's not provided, “de” (German) is taken as default. Capture ships with three languages “de”, “en” and “fr”

Embedding Capture

Usually, a direct communication with the Capture Ajax-Application is not required by the integrating host application. If, for some reason, a notification via callback-URL doesn't fit the customer's requirements (e.g. when embedded in another web application), alternative ways to communicate with the Capture browser frame are provided.

...

  • A JavaScript Window.postMessage is sent to the parent browser window carrying the message “capture.submitted”. This message can be caught in the parent window as shown in the following example:

    Code Block
    languagejava
    window.addEventListener("message", receiveMessage, false);
     
    function receiveMessage(event)
    {
         if (event.origin == "http://example.com:8080" && event.data == "capture.submitted")
         {          
              // …process data
              return;
         }
    }
  • As an alternative for older browser versions, which do not support postMessages, a popup window is shown, containing the HTML Element ID “save_successful”. By querying the existence of this ID in the document's DOM, the host application can determine when the commit of the document has been finished.

Infonote

Important: In these cases, the callback-URL requires to be an empty string on document upload!

As an alternative to the use of IFrames, the callback-URL, which was passed as parameter when calling the upload method, can be put as the current address for the currently active browser window (or tab) Capture is currently running in. To achieve this, additionally to specifying the desired callback-URL, a GET parameter has to be set when loading Capture itself, namely “redirect=true”.

Info

A code example for running capture embedded in an IFrame can be found here

Catching the Document-Dirty Status Events

...

For more information about how to catch post messages, please have a look at Catching the End-Of-Editing event.

Info

A code example for running capture embedded in an IFrame can be found here

Catching on-Load Errors

Currently there are two types of errors that can be caught via post messages:

  • Errors due to an invalid or expired document token will trigger a post message with the value “capture.error.invalidToken”

  • All other kinds of on-load-errors will trigger a post message with the value “capture.error.general”

Info

A code example for running capture embedded in an IFrame can be found here

Triggering the End-Of-Editing Event externally

...

When providing a button for performing an external commit, it is necessary to hide the default commit button in order to prevent users from using it. In order to achieve that, the GET parameter “hidemenu=true” has to be added to the URL when loading Capture itself.

Info

A code example for running capture embedded in an IFrame can be found here