cannot see my CUPS printer in system dialog - printing

I can't see cups printer in system-dialog but I am able to see my cups printer in chromiums print interface. When I select the printer and then hit the print button, nothing happens. There is no error_log in cups server. Also I can reach printer over the terminal and print every file format with lpr command. My CUPS version is 1.4.6 and using Epson TM-T20 thermal receipt printer. Chromium version is 37.0.2062.94 and libpdf is installed. I think that system cannot reach my printer. Also running on yocto os. All I got to resolv this is issue is 3 lines of Chrome logs :
[19001:19001:0511/231605:VERBOSE1:print_dialog_gtk2.cc(292)] Using custom paper size
[45:46:0511/231606:VERBOSE1:ipc_sync_channel.cc(385)] Canceling pending sends
[19001:19023:0511/231606:WARNING:raw_channel_posix.cc(214)] recvmsg: Connection reset by peer
Thanks in advance!

Actually the problem was gtk+ interface. Firstly, I installed cups-filters package after that, I added ghostscript and ghostscipt-cups as a RDEPENDS(running dependency) into both epson printer and chromium bitbake recipes. Finally, the real problem that not seeing printer in system-dialog, so I find out that's because of gtk+ interface. You have to override cups flag in gtk bbappend(or bb) with EXTRA_OECONF = "--enable-cups" also add a dependency to cups +DEPENDS += " cups ". That was my solution, I hope that works for your problems.

Related

Recent Microsoft patch breaks UWP printing to serial printers

Recently Microsoft deployed some security patch that has broken UWP printing to serial printers. These are printers that interface to Windows through either a USB serial port or a Bluetooth serial port. Symptoms -
Upon printing, a print notification appears:
Print Notification
Error printing on [printer name]
The printer couldn't print [print job name]
The print job appears in the printer queue with "Error - Printing" as status. Restarting the print job from the queue causes the page to successfully print, however having to restart every print job is not an acceptable solution for any application.
In the Windows event viewer, under Custom Views, Administrative Events, the following error is logged at the time of print failure:
"The document Print Document, owned by [user], failed to print on printer [printer name]. Try to print the document again, or restart the print spooler.
Data type: XPS2GDI. Size of the spool file in bytes: 182104. Number of bytes printed: 0. Total number of pages in the document: 1. Number of pages printed: 0. Client computer: [\COMPUTERNAME]. Win32 error code returned by the print processor: 3012. No printers were found."
I have duplicated this bug using the Windows Universal printing example from Microsoft
I have duplicated the issue on multiple PCs, running Windows 10 21H1, 21H2, and Windows 11. I believe the issue to be related to some recent security fix deployed by Microsoft but I cannot identify which one is the cause. The problem did not exist until recently.
Are other people seeing this? Does anyone know which KB patch is the culprit? Is there any fix of which anyone is aware?
Here is the fix. The fix takes care of both Bluetooth and serial printing issue in Windows with the symptoms as described above. In an elevated command prompt:
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers" /v {CA791BB3-9742-4A0F-87B8-B3C4B1065856} /t REG_DWORD /d 1 /f
After issuing this command, reboot the PC. The fix works for both Windows 10 and 11.
I’m hopeful that Microsoft is going to patch the issue in the near future.

Zebra Printer GK420d flashes green once, but doesn't print

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.

Printing From VIP fails to print

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.

How to use a host-based USB printer from WinCE

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

send command to zebra printer xcode

How would I send a CPCL or ZPL command to a Zebra printer through an app?
These commands would be similar to ones used in ToolBox.
For example how would I send "! U1 getvar "allcv"" to a printer and get the results.
I am using the Link-OS ios SDK and already have no problems connecting to and printing to the printers.
Did you ever figure this out? It's quite simple in the *nix world. If you send commands to the lp port via cat or some such, the printer will simply read them in. Note that this must be done as root if you don't have permissions set up on the device to allow normal users.
$ sudo cat command_file.txt > /dev/usb/lp0
So, I'm not a C or C++ developer, but the idea is the same in any language. Open the file for writing (probably O_RDWR so you can read back in any response from the printer) and then send commands to the fd returned from open().
You didn't specify an OS so I'll just stick with this *nix answer. That said, it wouldn't be different in Windows, I suppose. You just have to be able to find the right device.

Resources