Microsoft Point of Service won't detect printer - c#

Some background: I'm using an Epson TM-T88V receipt printer connected via USB with Epson OPOS for .NET version 1.12.20 installed. It is detected and can print test sheets just fine from the devices manager.
My problems begin with Microsoft Point of Service. It seems to not want to connect to the printer or even acknowledge its existence. The configuration xml file has been auto-populated (correctly I think?) and looks like this:
<?xml version="1.0"?>
<PointOfServiceConfig Version="1.0">
<ServiceObject Type="PosPrinter" Name="TM-T88V">
<Device HardwarePath="TM-T88V" Enabled="yes">
<LogicalName Name="EpsonReceiptPrinter" />
...
</Device>
</ServiceObject>
</PointOfServiceConfig>
However when I try to access it via posdm.exe "listdevices", it doesn't pick up on the existing physical printer and only lists simulators. Posdm.exe is clearly using this file, as it gets written to/read from when I use the "adddevice" command.
I'm fairly new to POS/OPOS programming, but I'm also assuming this is why the printer goes undetected when I try to access it via C# with the PosExplorer.
Is there anything I'm missing that would make the POS refuse to connect to my device?

After a lot of headaches and trial-and-error, I've found a way to make this work.
First, I happened to stumble across this forum post, which indicated that the current Epson OPOS driver I'm using might not support Microsoft PoS 1.14. So I uninstalled it and downloaded Pos 1.12 instead.
https://social.msdn.microsoft.com/Forums/vstudio/en-US/7fbc7186-560d-400b-9bfb-c638c5126e46/need-help-with-tmt20ii?forum=posfordotnet
And second, it seems that having any other windows drivers installed will enable Windows to take hold of the device and prevent any other applications from using it. So, I uninstalled the default Epson driver utility. This nugget of wisdom came from here:
http://discuss.joelonsoftware.com/default.asp?dotnet.12.699035.8
The combination of these two changes worked for me. However it seems Microsoft PoS is pretty finicky and a lot of the drivers out there leave a lot to be desired, so this might not be the solution for everyone.

Related

Zebra s600 print script

This is my first try to create a c# script to print a label from a Zebra s600 printen. I have a really hard time finding a good guide on the internet about how this would work. The Zebra s600 is also a very old model. Right now I am using the SDK from Zebra:
https://www.zebra.com/gb/en/support-downloads/printer-software/link-os-multiplatform-sdk.html#text_f34a
But I found out that the s600 is not included in the support list. My script does activated a little greenlight on the printer the moment I run the script. But nothing else happens. I also have no idea how to search further for my issue. Every search is a dead end.
I did followed this tutorial because I could't find any example on the web:
https://www.youtube.com/watch?v=RvWG9_rE9rg
Seems like it still supports ZPL. Have you tried sending ~WC? Try opening a command prompt and doing echo ~WC > LPT1 or echo ~WC > COM1.
If that prints a config label, then you can either use the ZDesigner drivers to print to it as a normal windows printer. If you do not find a driver for the exact model of printer, just select one with the same DPI and PDL.
Or you can write ZPL directly to the printer. To figure out what ZPL to send, you can use ZebraDesigner. The free versions are sufficient. Avoid the XML functionality unless you find the printer to support it - it was introduced after that series, I think.

Assign fixed COM ports to keyspan adapters on Windows

I have an application that reads and sends data from/to 2/3 machines attached to the PC through keyspan USB to Serial adapter. Sending/receiving works well.
My problem is that on restart of the PC, the COM ports are assigned "at random", often swapped. That makes automatic processing of data impossible.
I tried to manually set the COMm ports in the Device Manager and with Keyspan assist software without success.
Questions:
how to fix COM ports on Windows so after restart they are always same?
How to assign COM ports with java/c#/powershell (get ports setting and save it(once configured), set on next restart from configuration file)?
Thank you in advance for any suggestions.
Roman
thank you very much for your help.
In the mean time I've slightly modified the solution from http://syswow.blogspot.ch/2013/03/change-device-com-port-via-powershell.html
Unfortunately my current keyspan device ID's are not stable (KEYSPAN*USA19HMAP\00_00 and KEYSPAN*USA19HMAP\01_00 and KEYSPAN*USA19HMAP\02_00), as noted before. These ID's can and often change in between restarts (I suppose as Windows is "registering" them).
I have swapped to another vendor and now I get stable ID's / COM's (FTDIBUS\VID_0403+PID_6001+FTH8ZL5AA\0000 and FTDIBUS\VID_0403+PID_6001+FTH919SZA\0000 etc.).
Thank you once again for your help.
Roman
It's not possible without special USB drivers from your vendor. I don't know who made the USB drivers for your keyspan USB, but you might send them an email asking if they offer something like this. We use Silabs CP210X drivers for usb drivers for our products and they offer a special one that makes it so the COM ports are assigned and don't change randomly when our devices are plugged in. You might try it and see, but no promises it will work with your USB.
In my experience, COM port names are stable in Windows. I suspect there is something weird about the way your USB-to-Serial adapters were implemented, or something weird about the Windows driver you are using with it.
However, given that the COM port names are not stable for you, I would suggest using libusbp. It's a USB abstraction libary written in C which can enumerate the USB devices on your system and tell you the names of their COM ports. What you would do is:
Get a list of devices using libusbp_list_connected_devices.
For each device, call libusbp_device_get_os_id. This will return a string that is something like USB\\VID_1234&PID_DA01\6&11A23516&18&0000. That string should be stable across reboots, so you would have a list of those strings in a configuration file for your software.
If you see a device whose ID matches what is in your configuration file, then use libusbp_serial_port_create and libusbp_serial_port_get_name to get the COM port name.
The library is in C, but it can compile to a Win32 DLL, and you can use PInvoke (FFI) to call functions in it from C# or Java. The library might have some minor compilation errors if you try to compile it in Visual Studio, since it is mainly used in MinGW/GCC/clang environments. You should be able to fix those errors and/or report them as issues on GitHub.

Implementing Avery Monarch 9416XL printer into C# project

has anyone had any dealings with the above mentioned printer or one like it? I have been handed the task of introducing this printer into our c# project and am not sure where to start. I have created a sample .lbl file using Averys recommended software to get all of the dimensions correct. (Nicelabel SE)
the printer is connected to the PC via Network.
here is a Sample Image of the project that I am trying to create, I have spoken to one of the engineers at Monarch and he is helping me with creating a base file to send to the printer, and having some of the data as a variable.
ideally it would be good if I could launch a dos program which would handle this for me, but I seem to really be pulling at straws here.. I have seen the Zebra SDK, but im not sure if this printer is compatible.
Thanks.
I have spoken to the Guys from Avery and they built a template for me to use, and with a variable section in the code I was able to put in my own settings to get the required output.
To send the file to the printer I was able to use the LPR Service in windows using a batch file.

Server side printing of PDF files over the network installed Printers

Gone through the already existing posts on this topic, but my requirement is some what bit different.
Print jobs over the Network installed printers, upon a action in client side browser. Web server has got all printers in it, based on the client data, we need to print with client given configuration straight away, sending the job to printer(may be a different locations - but this is not a problem since the printers are in same network). I have seen printing architecture, Win32_print Class, SNMP, System.drawing.Printing, System.Printing.... but couldn't find the way to achieve this.. (Asp.net,C#)
-Files are been already existed in a server folder, just I need to pick up and send to a printer with client Selected Configuration...
update:I have to use JDF approach because all the files are PDF files. I am able to create JDF files with the selected configuration but sending this JDF to printer(JDF enabled) making me tough... There is JMF which post the JDF to printer, but not sure how to implement it.. still finding the ways, will be great if some one helps in this.
Something I can answer! 8-) I'm actually working on a project that uses this, right now.
Do not use Acrobat Reader as any sort of server application. It has a User Interface that will pop up on a screen that doesn't exist, at an unexpected time and freeze your app, waiting for a click that will never happen.
Use Ghostscript. Ghostscript is free, Open Source and will work perfectly for what you want. Out-of-the-box it consists of a DLL and a command line inhterface, however there is an API and a ton of different interfaces including .Net, and versions for both Windows and Linux.
On a more "overview" type of note, the reason you can drag a PDF into a printer on your workstation is because Acrobat Reader contains the code and hooks to allow this. Windows doesn't actually contain native functionality to print PDFs.

How can I install a printer using .NET?

I have an .INF for a virtual printer that I need to install from a .NET Application. I have done this before using batch scripts, but I am looking for a snippet of code to do this in the .NET Framework.
There's nothing particular about the printer .INF, so any code that installs a printer from an INF in C# or VB.NET will work.
I believe this is possible via interop to native win32 APIs, but I've found its much, much easier just to use a System.Diagnostics.Process() to call into printui.dll via:
rundll32.exe printui.dll,PrintUIEntry /?
Perhaps you're already using that in the mentioned batch script, but if not the parameters are documented here: PrintUI.DLL User's Guide and Reference
Just be sure to test it against all operation systems you need to support. Some options either do not exist in all Windows releases or have been renamed (although I think they're the more esoteric options - installing an .INF will likely work across the board).
You are going to want to look at the WMI objects available. These give you a finer control of the local machine settings. Take a look at the WMI code creator from Microsoft, I believe this will generate some example code you can leverage to solve your problem.
Administering Printer Settings in C# for Flexible Printing
see this article, it uses an MS Platform SDK DLL called PRNADMIN to manage printers, printer-drivers, printer-ports, ...etc.
I personally use it in a commercial project to install a printer driver and change the printer port to local port to intercept the Postscript. and it works like a Charm.
Alternatively you can use some pre-installed vbscripts that come with windows in C:\Windows\system32\Printing_Admin_Scripts and here is a an articles for them:
http://technet.microsoft.com/en-us/library/cc771846.aspx
This is not the ideal solution, but if nobody else answers, you can create a temp batch file and invoke that through C#/VB.NET.
Someone else will probably know a more natural way to do this.
You will need to wrap the setup APIs using PINVOKE or a native COM object.

Categories

Resources