Skip to content

cyrilrey/svg_label

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sorry, I do my best, but English is not my mother tongue. Is there somebody helpfull for making text below more readable?

SVG LABEL

You like labelling everything and with you ribbon printer Dymo or or Ptouch? But your are bored of being caught with overpriced proprietary supplies. If yes, grab your freedom with that project.

With almost dirty cheap ESC/POS compatible label printer and a raspbery pi, you now would be able to easily print your labels from web interafece.

Basically you will ,

  1. Open web page from you smatphone or computer
  2. Choose a template trought an SVG template collection (adresse, jam , note, on line text, two line texte, network, company logo ...)
  3. Enter custom text within an html form.
    • texts are remplaced into selected SVG file with a template engine
  4. Click print on preview windows
    • Your label is sent to your termal printer trought USB

Note : at that time project is not yet fully fonctional (see roadmap below), but it it going to be usable soon.

Scrennshoot

Prerequisites

$ sudo apt-get install python
$ pip install Flask
$ pip install flask-sessionstore
$ pip install python-escpos

Getting Started

  1. Clone Gith hub respository.
  2. Configure you printer usb port as below.
  3. Download Semantic-UI-CSS into Semantic-UI-CSS sub folder.
  4. Start web app with ./weblabel/run.sh
  5. Open http://localhost:5000 within your favorite browser.

Printer usb port setup

At the moment, you have to setup you printer manually. That mean filling correponding value within weblabel.py :

 p = Usb(0x4b43, 0x3538,0 ,0x82, 0x02  ) 

First and second value can be found with lsusb command before and after connection you printer.

$ lsusb
...
Bus 002 Device 078: ID 18f8:0f97  
Bus 002 Device 077: ID 4b43:3538   <--that one 
Bus 002 Device 076: ID 05af:1012 Jing-Mold Enterprise Co., Ltd 
...

Third and last value can be found with :

lsusb -vvv -d 4b43:3538 |grep bEndpointAddress
        bEndpointAddress     0x02  EP 2 OUT
        bEndpointAddress     0x82  EP 2 IN
        

Also, be sure your user have access to usb port :

$ sudo usermod -a -G dialout user
$ sudo usermod -a -G tty user
$ sudo usermod -a -G lp user

Road map

Work in progress :

  • Achieve function for replacing text within SVG, with jinja2 template engine.
  • Convert SVG into PNG according to printer print width resolution.
  • Make a small advertising video

Short :

  • Add a menu bare for advanced function and configuration.
  • Buttons for manual paper alignement. That mean printing a blank image 1px(fine), 5px(normal) or 10px(large) height on button press.

Medium :

  • Make a better advertising video
  • Better label size managment. Actually it works, but label height and intervall are "hard coded" within SVG. template.
  • Printer configuration page. Actually it works, but printer horizontal resolution is "hard coded".
  • Label roll configuration page and drop down selection.
  • SVG upload page.

Long :

Know issue

With inskape : flowed text won't show up on the internet. Convert back to regular text: Text menu > Convert to text. You might have to realign. Flowed text is created when you drag out a selection box before you type. To create regular text from the start, just click once and start typing. You can align/format afterwards using snapping and guides, if necessary.

Some old svg with no preserveAspectRatio property dose not work. You shold open with Inkskacpe and choose suitable for 3d print conversion.

Authors

See also the list of contributors who participated in this project.

Help from people with opinions and common sens are welcome.

License

This project is licensed under the GPL3 License - see the LICENSE.md file for details

Tested with

GOOJPRT PT-210 from Aliexpress Should work with almost all compatible POS thermal printer.

Label paper

Label 57*20mm

Releases

No releases published

Packages

No packages published