strowger / dymo-labelmanager Goto Github PK
View Code? Open in Web Editor NEWThis project forked from firedrake/dymo-labelmanager
Drive a Dymo LabelManager PNP from Linux
This project forked from firedrake/dymo-labelmanager
Drive a Dymo LabelManager PNP from Linux
txt2img and imgprint -- programs to drive a Dymo LabelManager PNP by Roger Bell_West (roger at firedrake.org) Updated versions of this software may be available from https://github.com/Firedrake/dymo-labelmanager The Dymo LabelManager PNP is a very fine small tape printer, conveniently sized and priced for someone like me who has low-volume label-printing needs. Unfortunately, because it registers on USB as a HID rather than as a printer, the Dymo-supplied Linux drivers are of no use with it. However, the printing protocol is similar to that used on the larger LabelMaker printers, and writing a program to access it at low level isn't too hard. Sebastian Bronner got there first with his dymoprint: http://sbronner.com/dymoprint.html which is a great starting point, but wasn't quite what I wanted: it can only produce lines of text in a single font. In the tradition of Unix programs, I wanted to split the functions: one program to convert text to bitmap, and another to send the bitmap to the printer. That way I could use an image editor in between to add barcodes, multiple fonts, and whatever other functions I wanted. Also I like Perl. And thus txt2img and imgprint. Both of these programs will need the non-core Imager module (on Debian, apt-get install libimager-perl). txt2img takes one or more lines of text and an optional font specifier, and produces a bitmap: $ txt2img -f /path/to/font.ttf "line one" "line two" "line three" By default it writes to txt2img.png; -o will change this. It scales the text to 64 pixels, this being the resolution of the LabelManager on 12mm tape. Multiple lines are centred by default; to change this, use "-a l" to align left or "-a r" to align right. To increase inter-line spacing, use "-g N" to specify a pixel gap of N. imgcombine takes several images and combines them into a single one; for example, you could have a text label from txt2img followed by a piece of clip-art. -o determines the output file (imgcombine.png by default). An image that is 64 pixels wide but not high will be rotated 90 degrees; otherwise it will be scaled to fit. $ imgcombine file1.png file2.png imgprint takes a 64-pixel-high image, crudely converts it to black-and-white if necessary, and outputs it to an attached LabelManager PNP. If it doesn't find one, it will fail with an error; you can use the -d option to specify a particular device (or even a plain file). Use the "-s" option to print a short label. This will advance the label past the cutter, but will not include the equal blank space after the cutter that forms the left margin of the next label to be printed. The next label printed will be right up at the leading edge of the tape. If you use this every time, the labels will come out as: [TEXT ][TEXT ] etc. which may be helpful if you plan to trim off the blank parts anyway. $ imgprint txt2img.png If you get a permission error, add a file 50dymo.rules in /etc/udev/rules.d that reads: SUBSYSTEM=="hidraw", ACTION=="add", ATTRS{idVendor}=="0922", ATTRS{idProduct}=="1001", GROUP="plugdev" then, still as root, udevadm control --reload-rules && udevadm trigger Feature requests are welcome.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.