Printing on local printer from web application with limitations - asp.net

I need to develop application, witch fetch data from some databases, compose document and then print it on local (label) printer.
It would be nice, if main application can be web based (ASP.NET). But I need control on the printing process to do not allow users to print the same document again.
Can you suggest me some solution? It is possible to create desktop application also, but we prefer web application.
One idea I have had was to implement some custom protocol as netmeeting does (callto://), but I don't know, if it is good idea and how difficult it would be.
Thank you for your advices.

I have realized this as I write by custom protocol (callto://) and I can recommend it. Protocol opens simple desktop application (it can be set up in windows registry) configured to print data fetched data to local printer.
In the protocol link a have base64 encoded url of webservice to ask for data and session id with customized print request for generating print data.
Works fine.

Related

Single Page Application with signalR: performance testing

I have an issue to evaluate the amount of concurrent users that our website can handle. Website is a Single Page Application built on .net framework with Durandal.js on the frontend. We use signalR (hubs) for real time communication between server and client.
The only option I see is ‘browser testing’, so each test should run browser instance (or use phantomJs etc) to keep real time connection with the server (as in real usage). Are there any other options to do this except use tests that will use browser instance to emulate user’s behaviour? What is the best way to emulate load of e.g. 1000 concurrent users?
I’ve found several cloud services that support such load testing, e.g. loadimpact, blazemeter. Would be great if someone can share their experience of using such tools.
SignalR provides tool called Crank, which can be used to test how many connections can be handled by given machine.
More info: http://www.asp.net/signalr/overview/performance/signalr-connection-density-testing-with-crank
Make your own script to create virtual users! that is the most effective way to recreate real world load/stress! use Akka Actor model(for creating virtual users) with java signalr client! (if you want you can use Gatling tool as framework and attach your script written in java or scala to virtual users of Gatling!)
make script dynamic by storing user info(Authentication token or user credentials) in xml document.
Please comment questions I can guide you end to end as I completed building+deploying such tool...

Best way sending a long string from client Silverlight to server ASP.NET code behind in quick succession?

I have a website that needs to act like a scanner - capture a normal image from a webcam and then process that image on the server. If that process fails to extract the required data (QR Code), capture another image and keep looping until processing is successful.
On the server side, I can process the string image using various classes - not a problem.
On the client side, I can capture an image using Silverlight.
Which approach is best in getting that string image from client to server for processing? I don't even need to send data back to client Silverlight as I could simply Transfer the webpage away when successful (but would be ideal if I could get a message back to the Silverlight App to stop so the user can remain on the same page).
Is using Silverlight the best way??? I've explored the WCF RIA Service option (which is completely new to me) but that appears only for linking to a database which is not necessary.
I'm not asking a solution here, just a pointer so I know which road to invest time in learning to meet this requirement. Never looked at JSON before... is that the solution?
I'm using Visual Studio 2010. Thanks in advance!
You can use webservice (.asmx) then you can pass the values from .aspx page to WebMethod in .asmx via JSON ..

How can I record audio in a web app client side and save it in a web server?

I have a requirement to do a flash program or something like that (not necessarily flash, it can be javascript or something in aspnet) that allow me to save audio in the client side of a web app, and save it on a file in the server side of the web app.
I've been searching a lot in google, and all I've found are just old questions, but no answers that fulfill my question
Please I need help!
Ive found this but the only thing that it does its to recognize the microphone, I need the hability of saving the audio file, by the way the server is implemented in aspnet
Possible Duplicate (when tagged with Flash)
How can I record audio using Action script then upload it to server?
The static function
Microphone.getMicrophone() returns a
reference to a Microphone object for
capturing audio. To begin capturing
the audio, you must attach the
Microphone object to a NetStream
object (see NetStream.attachAudio()).
There's at least one example in the
LiveDocs. Start at
flash.media.Microphone.
via #aaaidan
This is like asking everybody to do your entire homework for you.
You need to break the problem down into smaller achievable pieces/goals.
Example:
Record audio
Send to web server
Now you'll most likely get better results when you google it up.

How to print thousands of personalized documents over the web

I need to generate thousands of personalized letters from more than 800 workstations in diverse locations.
While we had only a dozen of customers per location, we used Crystal Reports over the web and its PDF/Word export function to produce multi-page document for print. With thousand of customers this just doen't work for the following reasons:
Browser unable to reliably download huge report
Server resourses insufficient to handle simultanious requests from several workstations
Even if Server and Client are Ok, you cannot start printing until whole reort is downloaded (i.e. for hours)
Workstations only have browsers and local high perfromance printers at the moment.
What is the solution for this problem? How should I do this?
In the past, we had a similar challenge. To solve it, we created a C# application which was installed at each location. It would communicate with the server via web services to get the data it needed to print.
Then we used the native printing functionality built into .NET for the actual printing. The downloads were quick, and it could handle high volume printing.
Since the question was clarified as:
Remote warehouse only has browser and printer. It connects to the server and enters information about the item that just arrived. In responce to that, printing of thousands of shipping labels should start, warehouse cannot wait until labels are printed elswhere and delivered to its location.
...the rational way to do this would be to make all the printers network printers. The workstations could share them using Windows networking, or pick your own favourite print server technology.
The web application needs to be told which printer needs the labels. It then prints to whichever print server is appropriate.
The alternative - download the document and print locally - is too user-driven to be appropriate in my opinion.

How to restrict what files a desktop app can download from an online server

The closest example I can think of is iTunes. I'm thinking about a system where a server stores loads of files, and each user only has access to those they have paid for. Using a desktop app, they can download these to their local PC where they are stored as regular files.
How might one approach this? I can see a couple of possible options, and have some initial thoughts, but would welcome feedback on these or other ideas. If you post your preferred design, people can vote on them!
1)Use HTTP requests, and the response is the file data. Then a simple servlet (or similar) can act as a control on which files are downloaded.
PROs: easy to do
CONs: seems a little hacky, how would you display a progress bar?
2)Use sockets, and a custom server app which pipes data to the server
PROs: Perhaps more performant (?), can send data in nice sized chunks
CONs: A little more work on the client side, quite a bit more to write a custom server-side app that runs 24/7
Thanks in advance. Someone please edit my tags, I can't think of the right ones!
Use HTTP requests, and the response is the file data. Then a simple servlet (or similar) can act as a control on which files are downloaded. PROs: easy to do CONs: seems a little hacky, how would you display a progress bar?
I don't see why this is hacky? Your App would authenticate using the user's user name and password (if you want it to work like iTunes) and fetch files according to permission level. A progress bar is easy to do because you will get the content-length header in the response. It's a more flexible approach than FTP - but if FTP already does everything you need, go for that.
As said, FTP is what you need. To control per user, per file permissions you can create one system user and then you can apply filesystem level ACLs. Then, a FTP server like PureFTPd will let you login with system accounts with the specified permissions.

Resources