Custom print on DNP DS620 cutting problems - linux

Hi everyone i'm currently using a DNP DS620 on a raspberry pi and i'm doing some printing with the lpr commands like lpr -P printername -o landscape picturename
This gave me a picture of 4x6 inch (10x15cm)
So i'm able to order some prints with a command system (good yeah!) but i don't find any way to use the cutting option to have a double 2x6inch picture at the end.
I know that some Epson printers use the source=DocFeedCut command but it didn't work in my case.
So does everyone know the command for that or a way to do that?

So I contact someone from the driver's developer's team explaining my issue to him, this operation wasn't possible at that time on this device. They made some modifications to enable this kind of process on this new kind of printer, now it's possible.

Related

How to run selected text using keyboard shortcut joined together with a command in background?

I am trying to be able to select text anywhere within my manjaro linux system and run it along with a TTS text to speech program. The program is called google_speech and it got a really clear default voice and is really easy to use, however I am finding it hard to implement what I want to do with it...
The program is ran by the following command:
$ google_speech -l en "I am just a robot but one day I plan to rule humans"
so I am trying to be able to select text and press a keyboard shortcut and the text will automatically be importing here:
$ google_speech -l en "HERE"
and ran as a command in the background hopefully without having to open a terminal window but if so then thats totally fine... I was thinking xclip would be able to do this but I can figure out what command or options I need to be using... my research so farhas gotten me nowhere...
Thanks you so much for your time and skills...

Printing to Star TSP143LAN from NodeJS on Linux, with formatting

I have the proper CUPS drivers installed: I can print to my Star TSP143LAN using any application with print capability (like Chrome). I can print to this printer using the node-printer module, by specifying either the printer name or the printer’s network address, and setting the print mode to TEXT.
But I can’t seem to format what I print from NodeJS using the node-printer library. If I set the mode to RAW and send commands as specified in Star’s Command Line Emulator manual for this printer, node-printer will report a successful print but nothing happens. It doesn’t print.
I’m attempting to send these RAW commands because I want to do various formatting operations like make the font larger or bold, and so on.
I’ve tried the node-thermal-printer module but I’ve had no luck.
I’ve been scouring the internet for some help on this issue but I haven’t been able to find much. I’ve seen it mentioned that the TSP143 LAN doesn’t communicate in the same way as other star products and it’s best to use Star’s drivers as a go-between, but I’m not sure what that means. (I thought I might be doing that already when specifying the printer’s class name when attempting to print from node-printer...)
I didn’t have much trouble implementing the Star Swift SDK into an iOS app and doing formatting operations there. But I need to print from a NodeJS environment on Linux. I’m at a loss.
If there’s anybody to whom this sounds familiar and can point me in the right direction I’d be very grateful...
Thanks!
After quite a bit of research, it looks like the Star TSP100/TSP143 LAN is not able to print using Line Mode Commands or ESC/POS from Linux: the solution has been to generate a PDF from HTML (using wkhtmltopdf) and then print the PDF using the node printer library (https://github.com/tojocky/node-printer). I have not yet found a better way to properly format prints.

How can I determine touch screen device in a bash script?

I am trying out the eGalax touch screen driver for my touch screen, as an alternative to the evdev/xinput_calibrator combination.
The calibration tool that comes with the eGalax driver, TKCal, takes the device to which the touch screen is connected as a command line argument.
Now I would like to start the calibration tool from a bash script. Is there some smart way to determine the device within the script, instead of hard coding "/dev/hidraw0" as in this example:
TKCal /dev/hidraw0 Cal
I presume that I can't rely on the touch screen landing on hidraw0 every time, can I? If I run my software on a different system, with a mouse and a keyboard and touch screen, I guess I have to handle that the devices can be conneted to different hdrawX devices. Please correct me if I am wrong.
Thank you very much!
/Fredrik Israelsson
Try looking at /sys/class/hidraw/hidraw*/device/uevent.
The guys developing the eGalax drive told be to try a much simpler solution:
Write a udev rule that will map the touch screen to a device name of my choice.

Ubuntu terminal in windows ? Can anyone explain the 'col' command in plain English for me?

Next week I am getting an exam on using basic commands and shell scripting using terminal in Ubuntu. Please help me out with two quick questions:
-Does a practice environment for the Ubuntu terminal exist? I don't want to dual boot with Linux, so I want to find somewhere I could practice using some basic terminal commands as Cygwin seems to be quite different from the ubuntu terminal.
-What does the col command in Linux do? The manual page is here: Link, but I find that hard to understand, and since it doesn't work in Cygwin, it's hard to interpret! Also, why would one use man piped to col -b -x?
Thank you very much and sorry for the probably silly questions!
You can use the Ubuntu LiveCD boot (boots up an Ubuntu system without actually installing it) and experiment with the Ubuntu terminal shell. Its actually the same CD as the standard Ubuntu installtion CD... you just chose "Try Ubuntu" instead of "Install Ubuntu" once it boots up:
https://help.ubuntu.com/community/LiveCD
col is program to filter out reverse-linefeeds (i.e. the backspace character) from text input. In the olden days of line printers, a common method to achieve boldface print was to print a character, then print a backspace character, then print the character again. This would make the printer strike the character twice in the same place. Some programs would emit text files formatted in this way (man is one such program)-- but if you then tried to display that text file to your terminal screen, you might end up seeing something like this: "here is b^Hbo^Hol^Hld^Hd text".
col -b simply filters text input to strip out those extra backspace and double-strike characters. The -x option converts tab characters to space characters, which might be useful if the output was formatted for a device with a particular tab width, but then displayed on a different device.
man pages often have the backspace/double-strike text embedded in them, so man piped into col was often useful.
Nowadays, most terminal emulators actually know how to handle the backspace/double-strike, so col doesn't get used as much.
Far better (easier to use, install, maintain, etc.) than Cygwin, and perhaps less resource-using than a virtual machine, is http://andlinux.org . That will give you a shell on your Windows desktop, and you can play with the col command to better understand it.
Win-bash is essentially the same shell as linux, but on windows. You can use this to experiment outside Linux but I'm not sure how effective it is.
Other options are virtual machines, and if you don't mind a reboot, you can install ubuntu with wubi which means it can be deleted from windows' add/remove programs when you are done with it. (Or just use the live disc)
Col has very limited use for most people, it only affects programs that write lines asynchronously as opposed to line by line...

linux clipboard read/write in C

I done lots of googling but I am still unsure on how to proceed.
What's the most common way of reading/write to the clipboard under Linux? I want both support for Gnome & KDE desktops.
Updated: do I take there isn't an easy solution and one must "aggregate" together multiple sources (gnome, kde) in order to craft a solution?
Maybe you can look at xclip and see how they have done it.
It provides an interface to X
selections ("the clipboard") from the
command line. It can read data from
standard in or a file and place it in
an X selection for pasting into other
X applications. xclip can also print
an X selection to standard out, which
can then be redirected to a file or
another program.
I might be shooting myself in the foot, but this could give you a hint on how to do the clipboard for kde, not sure about Gnome myself but try it, the script is in python and demonstrates how to get/set stuff on the clipboard, via using dcop and klipper, it is on this site here.
Hope this helps,
Best regards,
Tom.

Resources