Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can lprint support the xprinter xp-460b aka TCL TDP-247 on linux ? #6

Closed
dreamcat4 opened this issue Jan 17, 2020 · 11 comments
Closed
Assignees
Labels
question General usage question

Comments

@dreamcat4
Copy link

dreamcat4 commented Jan 17, 2020

Got here from apple/cups#5092 (comment)

via

apple/cups#5271 (comment)

Thank you for this project so much. It looks great. I hope that it can work with these TSPL2 language printers.

All of my findings about this specific printer's supplied linux driver were already written over on there cups issue tracker.

I shall also be running the TSC Diagnostic utility on it (windows) and post any further results as to find out if there are any other types of printer languages which it supports other than the TSPL2 described in it's PPD file. Have not had any time whatsoever to look into lprint itself just yet. Having only recently found it from your other recent comment on the future of CUPS roadmap.

BTW there are also seems to be some windows "SDK" development kit tools on the same drivers download page. However they seem to be closed source too. Providing some percompiled dll API to interface with. Same with the iOS SDK it's also a precompiled .a static lib. However perhaps we don't need any of that.

@dreamcat4 dreamcat4 changed the title Can this support the xprinter xp-460b aka TCL TDP-247 on linux ? Can lprint support the xprinter xp-460b aka TCL TDP-247 on linux ? Jan 17, 2020
@dreamcat4
Copy link
Author

Got the Diagnostic Tool (XPrinter's version of it) Working in win10 and it can communicate with the XP-460B label printer enough to print out some kind of a textual diagnostic information page out with the printer's full quality (203 ppi) was all looking fine and a great print.

The diagnostic tool was fun to play around with but ultimately didn't continue to work for very long and soon broke somehow the communication to the printer. Not sure why that happened but anyhow.

Found my printer also here on this product listing page where the specs claims:

распознавание языков управления: TSPL-EZ, EPL, ZPL II, ZPL;

So presumably that means it also can understand ZPL printer language. Although I'm not sure how that can be checked up on. The diagnostic tool showed the main settings as TSPL2 which was most comprehensive there. With a couple of extra tabs for ZPL and EPL. However those pages were very basic and not as many options / settings. I could not find a setting for dithering options any place in the Diagnostic tool. However there was a feature for querying the device's firmware, and it was showing a couple of firmware files on the flash ROM memory TSS16.BF2 (771680 bytes) and TSS24.BF2 (1737392 bytes). Which is presumably the printer's firmware itself. Maybe this can be reflashed with something else but I would first have to back it up. And know which other branded device / model from the other company was the same hardware etc. and obtain those other flash file in order to change the branding of the printer as it identifies itself. But perhaps that is not necessary at all in order to solve this dithering problem!

Next I shall look at your software here, the lprint program. And see if that can be of any help.

@michaelrsweet
Copy link
Owner

@dreamcat4 I'm not familiar with this printer, but given your research the ZPL driver should do the trick. Let me know how things work for you!

@michaelrsweet michaelrsweet self-assigned this Jan 17, 2020
@michaelrsweet michaelrsweet added the question General usage question label Jan 17, 2020
@dreamcat4
Copy link
Author

Hi again. I think the answer to this question is a tentative 'yes'. Because this morning I was able to successfully print out a PNG image through the driver named: zpl_4inch-203dpi-dt. And well... it printed something at least.

Here was the full string i used for adding the printer:

lprint add -v usb://Xprinter/XP-460B?serial=460BUG19A190014 -m zpl_4inch-203dpi-dt -d xprinter-xp-460b -o media-tracking=continuous -o media-type=labels-continuous

Where the 460BUG19A190014 is my printer's serial number. Anyhow that is not necessary to guess so long as your printer gets detected by lprint devices subcommand.

Still early days. It's not really 'usable' yet. There certain issues which needs more work. I shall come back soon to explain in more detail. Just so long as it's not me being the one who is too dumb / unfamiliar and cannot understand how to configure the printer settings myself properly. We shall see.

@dreamcat4
Copy link
Author

Continuing on from issue #9 [solved]

Thank you so much. This has now allowed lprint to set the options I am asking of it. It has solved entirely the feeding issue. It has allowed me to set the color mode (dithering) to 'bi-level', which has then solved my print quality issue.

Here were my settings for a successful print:

lprint 
-o media-top-offset=3.5mm 
-o print-color-mode=bi-level 
-o media-tracking=continuous 
-o media-type=labels-continuous 
-o media=oe_4x6-label_4x6in 
-o orientation-requested=portrait 
pdf-label_portrait.png

Now I need to figure out how to make myself a script that is launched from CUPS driver. To convert the PDF file to PNG using imagemagick, and perform a few standard transformations onto it. Then pass it over to lprint program for actual printing.

I have (for ebay 4x6 pdf Labels) the following commandline:

convert -density 320 pdf-label_portrait.pdf -scale 926x1463 -type grayscale -depth 8 -crop 812x1218+52+166 pdf-label_portrait.png

Which does some scaling and cropping of the borders to make it slightly bigger. It's also worth pointing out that eBay generate's it's labels assuming a 300ppi printer resolution. And this printer is only 203ppi. So there is some artifacting and lost lines / lost quality on the finer smaller text.

I shall also be trying other scalings / resolutions etc. To see if that aspect of the quality can be improved any further. But there is no dithering issue so the quality is so much better already.

@michaelrsweet
Copy link
Owner

@dreamcat4 If you setup a CUPS print queue using the IPP everywhere driver ("-m everywhere") then the PDF conversion should be handled for you. E.g.:

lprint server -o server-name=localhost server-port=8631
lprint add -d TDP247 -v 'usb://...' -m zpl_4inch-203dpi-dt -o media-top-offset=3.5mm  -o print-color-mode=bi-level -o media-tracking=continuous -o media-type=labels-continuous -o media=oe_4x6-label_4x6in -o orientation-requested=portrait

lpadmin -p TDP247 -E -v ipp://localhost:8631/ipp/print/TDP247 -m everywhere

@dreamcat4
Copy link
Author

Thanks @michaelrsweet that is a very helpful was to get the printer to appear to the system. Indeed I shall be trying that out! Very worthwhile.

But also in my own case, need to do some additional rocessing of the pdf file. Which I believe might require a more involved approach to include that step, making a direct single print through CUPS take care of that too. Which is more complicated. It would seem that these 2 stack overflow topics are trying to answer this question - how to hook in in a custom script to modify / convert the pdf before forwarding it onwards to the printer.

https://stackoverflow.com/questions/11192396/programming-a-filter-backend-to-print-to-pdf-with-cups-from-any-mac-os-x-appli

https://askubuntu.com/questions/981020/use-a-script-as-a-printer-to-process-output-pdf

Anyhow thanks so much for all of your help here, the last few days and getting this device working. It's really great! Thank you.

@dreamcat4
Copy link
Author

What I have not done is to try some more complicated cups scripts / hooks. To make insert my custom commands before printing.

Instead I installed inotifywait command on my distro and created a script / systemd service. It uses a 'watch folder' that will automatically trigger the printing process when any pdf file is ever saved or coped to that watch folder. The file is immedately removed afterwards.

Here is a link to how to set that up (works / tested on ubuntu only):

https://gist.github.com/dreamcat4/4240184f9299b211d2106bfef2d55518

@adamdport
Copy link

@michaelrsweet I've been waiting for 1.1 for months so I could try this with the EPL drivers! Unfortunately when I try to set the color-mode to bi-level to disable dithering, I'm getting Unsupported print-color-mode-default=bi-level(0x0004). Any ideas?

@michaelrsweet
Copy link
Owner

@adamdport Hmm, can you file a new bug report for this. I'll see if I can duplicate and, if so, try to push a fix out over the holiday break...

@adamdport
Copy link

@michaelrsweet actually nevermind, I found the lprint options command to spit out all the supported options, and it looks like my options are now "monochrome" and "auto"

  -o print-color-mode=monochrome (default)
  -o print-color-mode=auto

It doesn't look like either makes a difference, however, and I'm still getting dithered (jagged) barcodes instead of clean ones. Is there any other place to try to disable dithering?

@michaelrsweet
Copy link
Owner

@adamdport The code for this should be using the threshold dither (bi-level) for the draft and normal print qualities, but if that isn't working for you please do file a new bug. I can also add the bi-level support for print-color-mode but since most clients don't support that it would only help when printing directly with the lprint command (vs. from an application using the IPP Everywhere path...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question General usage question
Projects
None yet
Development

No branches or pull requests

3 participants