Send data from virtual printer to an application - c#

I'm doing Print Driver connectivity with desktop application.
I have the virtual printer written in c#.
I use RedMon to be the redirect monitor. See image.
My problem is if I write a desktop application with flutter, electron, or other cross-plataform framework, how can my application read the data received by RedMon?
In .NET, I could do this with BinaryReader standardInputReader = new BinaryReader(Console.OpenStandardInput())

Related

Connect to device ASP.NET MVC

I am new to ASP.NET MVC, i have to develop a web page that connects to a fingerprint device using its SDK (C# SDK), captures fingerprint image and display live preview from the device.
This page is working fine if the device is connected to the server that hosts my page.
The problem is when a client opens the web page and connects the device, the code that is written to connect to the device runs on the server so it doesn't detect client devices (Device SDK is installed on the server, so it detect device only if it is connected to the server).
Can i run device code on client side using c#?
You probably won't be able to access the device directly from code running in a web page. Some device manufacturers do make certain APIs available from the web (camera, GPS, etc), but only in a limited fashion. It's highly unlikely that you'd be able to access an arbitrary third-party device from a web site unless it can act as a standard input device (keyboard or mouse) and interact with an input element. For example, if it could fill a text box with a string corresponding to the fingerprint or allow you to take a picture of the fingerprint which could then be uploaded through a file input, then you might be able to use it.
The alternative is writing a secured plugin - Java Applet or ActiveX control - that accesses the device natively and use it to interact via JavaScript with your web page. User's would have to allow the plugin to be loaded and let it have permission to access the device for it to work.
For others who need help: I implemented a custom way to connect to USB devices connected to client workstation from ASP.NET MVC web pages.
Using Web Sockets, you can create your own client desktop application (c#) to connect to the device. This desktop application will be a Server for Web Sockets and then in your web page, you can implement a Web Sockets client to connect to the desktop application.
Client Sample (JavaScript)
<script type="text/javascript">
var ws = new WebSocket("ws://127.0.0.1:8080/service");
ws.onopen = function ()
{
};
</script>
Server Sample
static void Main(string[] args)
{
var wssv = new WebSocketSharp.Server.WebSocketServer(System.Net.IPAddress.Any, 8080);
wssv.KeepClean = true;
wssv.AddWebSocketService<Service>("/service");
wssv.Start();
if (wssv.IsListening)
{
Console.WriteLine("Listening on port {0}, and providing WebSocket services:", wssv.Port);
foreach (var path in wssv.WebSocketServices.Paths)
Console.WriteLine("- {0}", path);
}
Console.WriteLine("\nPress Enter key to stop the server...");
Console.ReadLine();
wssv.Stop();
}
More about Web Sockets in JavaScript: Html 5 Web Sockets.
Also, a good c# Web Socket Library: C# Web Sockets
Silverlight is a plugin available for some browsers that allows you to run .NET (C#) code on the client. It is similar to Adobe Flash or Java Applets. The development is somewhat similar to developing a WPF app.
Things I would be concerned about are whether you can access the device or not due to security restrictions. Also, see tvanfosson's comment on his own answer. It should be relatively simple to throw together a basic "Hello, world!" app to verify if you can talk to your device from Silverlight.
Another concern is that the last Silverlight support may not be top priority for Microsoft, and it has limited support on non Microsoft platforms.
Another technology you might consider is a ClickOnce application.

Development using Virtual printers instead of real printers

I want to develop an application that communicates with print spooler. The application is on .Net platform.
I want to have access to raw data of printed document but I want to use a virtual printer for this job. But I am unable to get the data from a virtual printer or raise an event whenever a print job is started. I checked the Windows system files and couldn't find a spooler for the xps printer.
I want to ask that does a virtual printer have spooler? If yes how can I access it because I couldn't find its spooler in the Windows files?
Can I use a virtual printer to develop an application that works with real printers?
Any help will be appreciated
Thanks

Does Windows CE 5 have a standard printing system?

I’m looking at creating a stand-alone application that scans several bar codes and at the end prints a receipt. I’m trying to understand from a developer prospective if there are standard calls to print via Windows CE.
The yet unspecified device would support at least Windows CE 5 up to a Windows Mobile 6/6.5. These would be a Motorola Symbol/Datalogic type hand held scanning terminal. The application would be used on whatever device we chose, not a broad range of products.
I’ve seen third-party libraries listed. Are these still relevant with more modern Windows Mobile releases?
I can send the specific codes to a printer outside of a printing system, but I don't want to go that route if printing is can be done "normally."
I expect to use VS 2005 or 2008 with C# depending on the model's support.
There is no printer support on Windows CE devices. What we've successfully done is to connect a Zebra receipt printer to the device via Bluetooth and send ZPL code directly to the COM port emulation. We were able to print on that device like this.
There is, however, no standard way that I know of.
While I'm not sure what more detail I could add, I'll try my best to describe what we did:
We had a little Windows CE industrial device (while I think it was a Datalogic device, the process should work with other devices, too) with Bluetooth support and a Bluetooth receipt printer that was capable of understanding the Zebra printer language (ZPL).
We connected the printer to the device via Bluetooth so that we could access the printer via a "Bluetooth COM Port". From then on, we were able to send ZPL code to the printer from our own applications and have the printer print what we sent, just as if the printer was directly connected using a serial cable.
In our application we had a little ZPL template into which we filled the information required. The user was then able to walk around with the mobile device, fill in forms and print labels.
The only catch was to re-enable the Bluetooth pairing after the scanner had gone into suspend mode, but I guess that's something you have to figure out depending on the device types - maybe there are even settings to have the connection re-established on your device.

Send information to COM port from MVC.NET app

Is there any way to send information from my C# MVC.NET application (that is on a server computer inside a local network) to another PC (in the same network) which has a (fiscal) printer connected in a Serial Port?
My webapp is working ok, and I have a winform app that works ok too. But I cannot connect them.
So I think in sen all the information directly from the web app to the specific IP and COM port.
Is that possible in c#?
Physical hardware are not accessible from web application. You have to create windows services for printing. For the printer it doesn't matter that printer is installed on which port it can be on USB or COM port. If you want to print webpage then simply press Ctrl + P then you get print dialog or you can page.print() javascript method.

Communication with Zebra RFID Printer | C# .NET

We are developing an application which prints RFID labels using Zebra RZ400 RFID printer. Until now, we were sending ZPL commands by RawPrinterHelper class which makes call to winspool.drv.
However, we soon realized that not all tags are printed successfully so we looked for a way to get feedback about the success of the last print operation. There is a command "^RV" that is said to return a string upon a print operation that reflects operation success result.
Now, the problem is we don't know a way to get this feedback data from printer! RawPrinterHelper class does not have any method to get data.
I connected the printer to USB and used LibUsbDotNet library to communicate with the printer. I can send commands to printer successfully including "^RV" command and read from USB again to get the feedback from printer. I can get the feedback value but not every time, only once after randomly printing lots of tags.
Is there an offical SDK from Zebra to communicate with printers? What can be wrong about USB communication? Please share your experiences regarding Zebra .NET development.
There is an official Java SDK which does bi-di communications to the printer using the Windows driver (for USB. It does direct for Tcp). There is also a Windows Mobile SDK from Zebra which might work for you.
You can try dropping in the dlls, and then take a look at the UsbPrinterConnection class. Lemme know if it works for you
TCP/IP Bidirectional Programming Example Using Sockets - C#
https://km.zebra.com/kb/index?page=content&id=SA140&actp=LIST

Categories