Skip to content

talpadk/ptouch-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#A php class for printing out labels on Brother P-touch printers ###Supported models include (PT-P700, PT-H500, PT-E500) What to expect

The code is being developed / tested using a PT-P700, but the protocol should be the same on all three models.

The php class is intended to be used as part of a web page allowing it to print labels on a printer connected to the web server.
However the code also includes some php scripts to allow printing from the command line.

This is NOT A CUPS DRIVER nor is cups or any other printer systems required to print.

Requirements

  • PHP
  • libusb module for PHP see: php-usb for details on installing it
  • GD module

sudo apt-get install php5 php5-gd

Note:
The user running the command/script must have permission to use the USB device.
Please consider looking into using udev to grant you permission to use the printer.
Alternatively you can test the script using 'sudo'.

Contents

  • ptouch-utils/PtouchPrinter.php The printer class file
  • ptouch-utils/ptouch-img A script that prints an image on a label
  • test/test.png A test image that fits on 24mm labels
PtouchPrinter.php

A class for printing GD images, see the code for doxygen comments explaining how to use it

ptouch-img

Usage: ptouch-img path_to_file

The image file may be a .png .jpg or .gif.
It must currently be 128 pixels high.
Only the red value of the pixels are considered in order to determine if a black pixel should be printed

As an example from a fresh git clone:

 sudo ./ptouch-utils/ptouch-img test/test.png

About

A php driver for Brother P-touch lable printers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages