I'm using a service on multiple computers that is essentially a socket and TcpListener that listens on a port for a message. This message is a byte array of ZPL code. The service then sends this array to a USB connected Zebra GK420d printer and then prints it. The byte array is sent from another application where users select different label layouts for different products. The other computers do not have admin privileges but i do not think this is the cause.
I've got the printers working on the computer at my desk and one other computer, but on other computers (about 10 more) it doesn't . All computers have a connected USB Zebra GK420d printer.
The issue I'm having is the printers flash green once, but it does not print. I know for a fact the service works fine, as when I view a CMD window, I see the ZPL message and the printer it is trying to send to. This suggests the service works and the printer gets the message, hence the flash.
I've tried a variety of drivers, updating the drivers, different USB ports, updating the .Net on the computers, deleting the printers and reinstalling them etc but nothing seems to be fixing the issue. They print test pages fine so i'm not sure what the issue is.
The computers/printers all now have identical printer properties / preferences / drivers and Windows version. However the printers were all bought at different times over the last 6 years.
I strongly recommend using the text based driver. If you are sending ZPL, that's the the cleanest option. If it didn't work before, try a simpler label/ZPL blob; there could be something wrong with the ZPL you are sending.
Else, I found this: https://code-examples.net/en/q/43c80a
Right-click on the Printer and choose "Properties".
On the "General" tab, click on the "Printing Preferences..." button.
On the "Advanced Setup" tab, click on the "Other" button.
Make sure there is a check in the box labeled "Enable Passthrough Mode".
Make sure the "Start sequence:" is "${".
Make sure the "End sequence:" is "}$".
Click on the "Close" button.
Click on the "OK" button.
Click on the "OK" button.
In code, add "${" to the beginning of ZPL and "}$" to the end. This is with the Windows driver for ZDesigner.
Turns out it was due to the ZPL code not having a new line at the end of each ZPL file that got sent over the stream.
Related
I am working with MC9500 Motorola handhelds, Zebra RW-420 printers, and the VIP Application. When I go to print a test page it reads the error:
Failed to read 1 byte(0 read)
Troubleshooting:
-I have successfully printed from other RW-420 printers
-Sent the printers that had this error back to Zebra(now they can print via Bluetooth but still show that error)
-Made sure I have the correct COM Ports
-Reset the printers multiple times on the Zebra Setup Utilities
-I have updated the firmware on the printer
-Tried changing the printer language but nothing helps
I have tried searching for this error but I haven't seen anything relevant yet. Please let me know if there is anything I am missing.
There was a different way to change the printer language and a few other configuration settings that needed to be changed beforehand.
I'm testing an HP LaserJet printer with WinCE7, it's a host-based (not PCL) printer.
When it's plugged into the USB port of WinCE, the USBPRN.dll is loaded but PCL.dll is not loaded which is as expected.
I included wordpad in WinCE and tried to print from wordpad, but there is a error message box saying no printer babah. Printer setting dialog box is not displayed.
Then I use CreateFile/WriteFile/CloseHandle APIs and try to send some ASCII string to the LPT1 port.
The return handles are valid but nothing happened on the printer. According to the debug log, I see something wrong inside WriteFile although the return value is valid.
Then I'm stuck.
I have several other options to try:
Use OpenPrinter/StartDocPrinter/WritePrinter API set. But I'm not
sure if they are different from CreateFile/WriteFile/CloseHandle.
Check to see if there's any open sourced driver for the printer in
Linux world, then I can see what's the data & format I should send
to the printer. But I don't know Linux at all. I'm not sure what
part is different from Windows to Linux or what part is same to
different OS.
Anyone can point out any information about how to implement a
host-based printer driver? Just introduction about the architecture
is also welcome. For example, is there anything related to the
device context (DC) or bitmap or anything else.
I'd like to see any comment on which direction I should go.
Thanks,
Fei
We use SATO CL412e printers to print labels (3x7), with the label coming from a local SSRS report. Until recently, this setup worked without issue. A few months ago we modified the label, and implemented (new implementation) at one site (Site A). Then a few weeks ago, we pushed the change out to another site (Site B) that had previously been using this label (old version). Since we did this, the label at Site B is... weird.
The barcode is quite clearly not right, and all the normal characters are squished together, and perhaps bolded. Theoretically, we have proved that it is not the application (which recently changed as well) or the label report because it works fine at Site A, as well as from a different printer (same model, same drivers, etc.) at Site B.
Yesterday the drivers at Site B were updated to match Site A, which resulted in no change. This morning we found a few settings in the web interface that were different. I have not heard yet, but I seriously doubt it will have an effect.
What am I missing? To date, this exactly configuration works on three printers, and fails on one. I am at a complete loss as to what to check next. What could possibly cause this behavior?
Edit:
It has been discovered that this happens only through RDP. When we use a Citrix connection to the same server, we have no problem. It has been suggested that maybe this is a problem with the Internet Explorer settings. Any basis to this, and what settings?
RDP has a feature which connects your local printers to the remote server. This can mean the printer you get when connected with RDP is different than the printer when you are locally working on that server, or using Citrix. It's possible your local workstation has the same printer defined with different settings.
In your RDP connection dialog, click "Settings" and click the "Local resources" tab. Then clear the "Printers" checkbox to prevent this behavior.
I'm developing an internal Google Chrome Extension that needs a way to initiate print the current page to the printer. I do not want the default Print dialog to come up (so, javascript:window.print() is out of question).
As far as I understand, this is not possible just with the JS + HTML plug-in, so I'm also open to using the NPAPI plugin also (with a dummy mime-type). And I'm concerned for Windows platform only.
I'm also open for various hacks / workarounds if possible, though a standard solution would be nice.
If you think this is not possible, let me know if you know any feature request logged for it?
Any suggestions/clarifications are welcome..
In chrome (v18+) we have the --kiosk --kiosk-printing switches. One can print automatically to default printer without print confirmation.
You can see it from this video http://www.youtube.com/watch?v=D6UHjuvI7IE
Since NPAPI allows you to create native C++ plugins that you can interact with through an object tag (which you can use from an extension), that would probably be the way to do it.
The tricky bit is that I don't know of a good way to get the bits for printing the page. The only person I know of who has done something similar to this actually got the window handle for the browser (available through NPAPI) and scraped the bits off of it to print that way, but that won't take into account print stylesheets or anything. You could also try using automation events to try to control the print dialog, but I have no idea if that would work or not.
By design, the browsers try not to let you do something like this, as it could open some serious vulnerabilities if any website could just start printing things to your printer without confirmation...
Anyway, if you find a way to do it with C++ you can use FireBreath to ease the creation of the NPAPI plugin.
There are various extensions that take snapshots of the current web page (for example, this one); you could adapt one to send the image to a printer via an NPAPI plugin.
I've recently been looking for a similar ability, and it seems like it would be quite possible using Chrome's new native messaging api.
https://developer.chrome.com/extensions/nativeMessaging
There are plenty of examples of this with C#, but here is one quick example of troubleshooting Chrome native messaging with a basic C# application
Native messaging from chrome extension to native host written in C#
I realize this may be a day late and a dollar short, but in case anyone else comes across this question, this is the solution that worked for me. From inside a C# app, you can directly print to installed printers using the PrintDocument class. If you figured out a way to get the page image, this would be far easier than using firebreath or NPAPI.
Disable print preview in Google Chrome on Mac
Quit Google Chrome
Launch Terminal on your Mac. (Search “Terminal” using the Search box)
Type defaults write com.google.Chrome DisablePrintPreview -bool true
Close Terminal and open Google Chrome
Disable print preview in Google Chrome on Windows
Close Google Chrome
From your desktop, right click Google Chrome
Click Properties
In the dialog box, add ‘ –disable-print-preview‘ at the end of the Target field sans the apostrophe (make sure to include the space before –)
Click Apply
Disable print preview in Firefox on Mac
In the address bar type “about:config” and press Enter.
Right click on the page, hover over ‘New’ and click on ‘Boolean’
Type ‘print.always_print_silent’ as the preference name and click ‘OK’
Click on ‘true’ and click ‘OK’.
Close the about:config window.
Disable print preview in Firefox on Windows
In the address bar type “about:config” and press Enter.
Right click on the page, hover over ‘New’ and click on ‘Boolean’ Type
‘print.always_print_silent‘ as the preference name and click ‘OK’
Click on ‘true’ and click ‘OK’.
Close the about:config window.
https://support.dryfta.com/how-to-disable-print-preview-in-chrome-firefox-on-windows-mac/
I have created a Delphi service which is responsible for printing QuckReports to specific printers contained within the printer.Printers list. I pass my routine the printer name and it looks up in the printer.printers array to get the proper index. It then does this:
QuickRep1.PrinterSettings.PrinterIndex := iIndex;
In the help files it says this for printer.refresh: "Call Refresh when the installed fonts or printers on the current system may have changed". So I call the refresh before I look up the printer name against the printer.printers array.
At one of my installations this function is not working properly. If printers are added/deleted, or someone with printers under their profiles logs on, the list does not seem to get refreshed until the service is stopped and restarted.
Does this function not work for services?
The installation where this is occurring utilizes "virtual services". Could this have anything to do with it?
Thanks.
My experience and understanding is the printers array is updated only at application start. Anytime a new printer is installed, the application must be restarted to get the correct list.
I'm curious to hear any different experience with this myself.
EDIT: From my comment below; I wrote a small test program that confirms the TPrinters.Refresh() does update the printers list.