Passing text data from silverlight to plain page - silverlight

I have written app in silverlight which reads qr codes from webcam. I need to pass data (paste pure text) from silverlight to active field on page which contains silverlight, but not inside silverlight. Is there any way to do this? There is also restriction that user interacts by showing qrcode to webcam not actually clicking anything (problem with clipboard and silverlight - which can be used only in certian situations).
Any suggestions or guidelines is welcome.

You can interact with the page hosting the Silverlight object. From Silverlight:
HtmlPage.Window.Eval(string.Format("processQrCode('{0}')", textData)
There should be javascript in the page:
function processQrCode(data) {
// Do something with the data here
}

Related

Aspose PDF viewer

I am using the Aspose PDF tools and have successfully got it to print the pdf which is great, but ideally I want to be able to add a wpf control to display this as well.
I would have assumed that the PdfViewer class would have something, but I can't tell.
So far I have needed to use a different control MoonPdfPanel which is annoying as I would have preferred 1 tool to do both jobs.
Does anyone know of a control I can use to hook into the aspose?
Thanks
We have developed an HTML5 PDF Editor application using Aspose.Pdf for .NET API which you can use in your application as a PDF Viewer as well. You can get the details and complete source code here. You can use the source code to edit the viewer as per your requirement.
P.S. I am working as social media developer at Aspose.
Well, if you are interesting in viewing the PDF file, you may convert the file to HTML and display it using an IFrame in your application. I have developed a sample application which performs different operations including viewing a PDF file in IFrame. Download it and try it at your end. Another option is that you can convert the PDF file to images and display in Imageviewer in your application (Code is available in the above application).
P.S. I am working as social media developer at Aspose.

Screen scraping silverlight browser application info

I'm registered to a site which uses a silverlight application that shows some personal information.
My goal is to be able to read some data from the silverlight application.
Is it possible?
I know that this could be done to a regular web page using curl.
but, what about silverlight application?
Does it store the information to a file or something like that?
Thanks
You can use White, a tool for automating windows applications, to get information out of a running Silverlight application. White is mainly used to perform functional testing of applications, but it should allow you to extract information from the application as well.
Look here for an example of White and Silverlight: http://www.codeplex.com/wikipage?ProjectName=white

Showing the result of a WebClient-postback in an Browser Window from Silverlight 4

I want to show the result of a WebClient-Postback in an new Browser-Popup-Window. As the "Navigate" and "Popup" methods of HtmlPage only support Get-requests, I issued an POST-request to an REST-Service via WebClient. But now I want to show the result (e.g. application/ms-excel or application/pdf) in an new Browser-Window.
Therefore, can I open an new BrowserWindow and set its contents as well as some corresponding http-headers with on-board means of Silverlight 4? Or even better, is an easier way to trigger the browser to do the POST-request to the service?
Best Regards
I tried going this route but the WebBrowser control is not opened to the developer. What I did as a temporary workaround was to open my webpage http://www.xyz.com/default.aspx inside the WebControl and let the page drive the rest.
Mike Taulty had an example for somthing like this, how you can use javascript to communicate back to the silverlight app through InvokeScript:
http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2009/11/18/silverlight-4-rough-notes-html-hosting-in-the-webbrowser-control.aspx
I hope it helps!

Silverlight Bing map question

I am planning to use Silverlight control for bing map. It will be used in a ASP.Net website.
Note: I am new to Silverlight and Bing map.
How the Silverlight bing map control will behave? Will the bing map service be called from the client browser or the web server?
Is there any architecture diagram related to this?
Please help.
Thanks
Lijo Cheeran Joseph
A good place to start is on the following link:
http://www.microsoft.com/maps/product/faq.aspx
I do not know about any architecture diagrams. With the Silverlight control (the preferred control at this point, over the old AJAX control), the map service is called from the client browser...it is called from within the Silverlight application that hosts the map control, which like all Silverlight applications, runs exclusively on the client.
You could make calls to the Bing web services server-side, then use that data in some way, but if you're going after an interactive map, you will want the Silverlight control.

Silverlight webpage preview control

I'm making a silverlight app that when the user does a mouse-over some tab bars, he/she will see a preview of the page it will link to. The reason for this preview is that just having a visual miniature of the page is often enough to make the desicion for the user. How do I in Silverlight make a control that simply displays a webpage, preferably scaled down?
Cheers
Nik
As you are probably aware, there are some issues relating to crossing domain boundaries in Silverlight. Issues that have been discussed on stack overflow for example.
This is relevant because generally you can't request web resources in other domains which you'd need to do here.
One way I've seen to get around this is to use a web service that doesn't have the same limitation. So you can create a web service that exposes a byte[] of the image and have the web service do the calls to retrieve the image and send it back to Silverlight.
Once you've got the image byte[] you can read that in an asynchronous call, and set the image source like this.
BitmapImage thumb;
using (MemoryStream stream = new MemoryStream(imgArray))
{
thumb = new BitmapImage();
thumb.SetSource(stream);
}
The other issue is how to generate the thumbnail, for that you can google, there are some projects that show you how and some public web services that do it for you. Amazon's is one such example.

Resources