Skip to main content

inventree-ptouch-endless-plugin

A label printing plugin for InvenTree, which provides additional support for Brother PTouch series printers.

Notable Features

  • Dynamic length labels, depending on the size of the content
  • Pixel perfect rendering using a custom base template
  • Automatic label width setting
  • True length, the labels length will be nearly the requested template width (about ±0.5mm which is a hardware limitation)

Template examples

Basic example

The generated pdf will cover the printable of the label exactly, one px in css is a actual pixel on the label, enabling consistant 1px features like a 1px border.
The Height [mm] from the template settings will determine the tape width (has to match what is in the machine) and the Width [mm] will determine its length. The printable area will be a bit smaller, as there the printers have a inherant margin on all sides.

{% extends "label/ptouch_base.html" %}

{% block style %}
.border {
  width: {{ width_px }}px;
  height: {{ height_px }}px;
  border: 1px solid black;
  box-sizing: border-box;
}
{% endblock style %}

{% block content %}
<div class="border">
  Hello World!
</div>
{% endblock content %}

Dynamic Width

By including {% shrink_if_possible %} in your {% block content %} the printer driver will cut of any whitespace to the right of the label, resulting in a label with a variable width depending on the content. The Width [mm] from the template settings is the max width in that scenario.

{% extends "label/ptouch_base.html" %}
{% load ptouch %}

{% block content %}
  {% shrink_if_possible %}
  Hello World!
{% endblock content %}

Supported printers

The plugin is based on labelprinterkit which supports the following printers:

  • P700
  • P750W
  • H500
  • E500
  • E550W

The plugin has only been tested with a P750W. The build in margins have been measured from labels printed by the P750W, if they dont fit other printers, provide me with better values through a issue or PR. Other printers of the PTouch series might also work, but this is purly a suspicion.

Minimum Requirements

This plugin now requires the InvenTree version 1.1.0 or newer.
The plugin might function correctly on an InvenTree instance below version 1.1.0, but this has not been tested.

labelprinterkit

This plugin contains parts of https://github.com/ogelpre/labelprinterkit. Which could not be included via a dependency due to version conflicts.

Metadata

Release files for inventree-ptouch-endless-plugin 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for inventree-ptouch-endless-plugin 0.1.0
File Size Uploaded
inventree_ptouch_endless_plugin-0.1.0.tar.gz 35.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for inventree-ptouch-endless-plugin 0.1.0
File Interpreter ABI Platform
inventree_ptouch_endless_plugin-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 81.6 kB

Release files / inventree_ptouch_endless_plugin-0.1.0.tar.gz

Download URL inventree_ptouch_endless_plugin-0.1.0.tar.gz
Size 35.2 kB
Tags Source
SHA-256 checksum
How to use checksums
752ae21beeaa53c44b1445e3490603f7d8211a27360da6ad38fbb2ce49027674
BLAKE2b-256 checksum
How to use checksums
eb1b011dd7a3e68b7ae9fc4f6f944d8a27a6c0d19c0bca0e75134983e1bf69c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / inventree_ptouch_endless_plugin-0.1.0-py3-none-any.whl

Download URL inventree_ptouch_endless_plugin-0.1.0-py3-none-any.whl
Size 46.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
469b6c069fc1e22db66ea21a9bfcfc36888c9ae61042b578b00caeb864f35270
BLAKE2b-256 checksum
How to use checksums
7a3f16ef4396d8cb1436570eb8a2160aa9bea5f37ab38e51b8cd3a0d9d3a2e6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page