Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Friday, February 17, 2012 6:44:27 AM(UTC)

Carlos_LEAD  
Guest

Groups: Guests
Posts: 3,049

Was thanked: 1 time(s) in 1 post(s)

Attached is a project which demonstrates using TWAIN in-browser with Silverlight 5 via a COM object created with Leadtools’ .NET Twain DLLs. There are a few important things to note:

1.)    In order for our Silverlight Controls to function properly in Silverlight 5 (for example the RasterImageViewer in this sample application), you have to make sure you reference System.Windows.Controls.dll version 5 in your project.

2.)    Using COM objects in-browser will require elevated trust for the in-browser application. Instructions can be found here on how to enable Trusted Applications to run inside the browser: http://msdn.microsoft.com/en-us/library/gg192793(v=vs.95).aspx

Here are some detailed instructions for setting this up:
(***Please note that you need to perform all of these steps to get the example running)

To set the registry:

  • go to your start menu and search for “regedit”.
  • Open this program and navigate down to HKEY_LOCAL_MACHINE\Software\Microsoft\Silverlight\ (if you’re on a 32 bit OS) or HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Silverlight\ (if you’re on a 64 OS)
  • Now right click on the “Silverlight” registry and go to New->DWORD. Set the name of the dword to “AllowElevatedTrustAppsInBrowser” and set it’s value to 1 (0x00000001).

 
To create and install a test certificate:
(***Please note that this must be done in the project properties for the Silverlight Application—not the COM-Wrapper)

  • Open the properties of your project and under the “Signing” tab check the “sign the Xap file” box. Now click “Create Test Certificate” choose a password and click OK.
  • Click on “More Details… -> Install Certificate”.  In the window that comes up, click “Next” and then select “Place all certificates in the following store”. Browse for the “Trusted Publisher” store and Finish. Now repeat this last step and install to the “Trusted Root Certification Authorities” store.
  • Go to the “Silverlight” Tab in your projects settings. First check the “Enable running application out of browser” button. Open the “Out-Of-Browser-Settings” and check the “Require elevated trust when running outside the browser” box. Click OK. Now disable the “Enable running application out of the browser button”.  Finally enable the “Require elevated trust when running in-browser” box.

 
3.)    As shown in the above instructions enabling the application to run as a trusted in-browser application requires that it also be trusted as an out of browser application. You can toggle running in browser/out of browser by checking/unchecking the “Enable running application out of browser” box. Just make sure that both in-browser and out of browser settings require elevated trust.

4.)    Deploying in-browser applications which use COM objects in this manner will require end users to set the registry permissions manually (registry entries cannot be changed from within the browser).

 

 
File Attachment(s):
COM_TWAIN_SL5 .zip (19kb) downloaded 102 time(s).
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2017, Yet Another Forum.NET
This page was generated in 0.153 seconds.