computerlyrik / dymoprint

Linux Software to print with LabelManager PnP from Dymo
Apache License 2.0
150 stars 51 forks source link

labelle-gui Printing with copy & paste ? #123

Open jenom1957 opened 1 month ago

jenom1957 commented 1 month ago

I am considering to try out labelle-gui, however I would like to add a text to print with a simple copy & paste from Libre Office Writer. Please let me know if this is possible? Thank You !

maresb commented 1 month ago

Hi @jenom1957, thanks a lot for your interest!

I'm not following your idea. Could you please be more specific? What does not currently work regarding copy and paste?

jenom1957 commented 1 month ago

Hi there! here is in details: I want to select (highlight) a text in a Libre Office Writer document, then copy with CTRL+C and than paste it with CTRL-V into an open labelle-gui window for printing with a Dymo Label Writer.

jenom1957 commented 1 month ago

I can see on a Sample labelle-gui, it has a line to add a FILE location ....but can I paste a selected text in there ?

Labelle_example_2

maresb commented 1 month ago

@jenom1957, have you attempted to do what you propose, or are you just looking at pictures? I'm still confused.

jenom1957 commented 1 month ago

No, I did NOT attempt...still using Windowz with Dymo's official program. If YOU have labelle-gui installed, please copy and paste some text into gui windows >>> And tell me if it prints it out? Thanks!

maresb commented 1 month ago

Hi @jenom1957, I didn't realize you were using Windows. I don't have Windows myself, so I can't try the experiment. However, people have managed to run the Dymoprint CLI by setting the driver to WinUSB using Zadig. This is not well-tested, but in principle it should work with both the Labelle CLI and Labelle GUI. I'd be grateful if you could try it out and report back.

maresb commented 1 month ago

For the record, on Linux when a supported device is connected, copy-paste of text from LibreOffice works as expected. Note that the font information (font, size, style) is not pasted, it's only the text itself.

jenom1957 commented 1 month ago

I will try it out once have Linux installed. Any recommended small linux distro which runs on a 10-15 old hardware ? Thanks!

maresb commented 1 month ago

I'd expect Zadig to be much simpler than installing LInux.

Regarding a Linux distro I don't have any particular recommendations, but below is what ChatGPT says:


For old hardware that's 10-15 years old, you want a lightweight Linux distro that can run smoothly with limited resources. Here are a few solid recommendations:

  1. Lubuntu: A lightweight version of Ubuntu using the LXQt desktop environment. It’s designed to be fast and energy-efficient, making it perfect for older hardware.

  2. Xubuntu: Another variant of Ubuntu, but this one uses the Xfce desktop environment, which is also light on resources. It's user-friendly and has good community support.

  3. Linux Lite: Based on Ubuntu LTS releases, Linux Lite is a great choice for older hardware. It uses the Xfce desktop environment and is specifically aimed at Windows users, making the transition smoother.

  4. Peppermint OS: Known for its speed and efficiency, Peppermint OS combines elements of cloud and local applications. It uses the LXDE desktop environment, which is very light on resources.

  5. Bodhi Linux: A minimalistic distro that uses the Moksha Desktop environment. Bodhi Linux is designed to provide a balance between minimalism and functionality.

  6. AntiX: A Debian-based distro that's super lightweight and designed to be fast and efficient on old hardware. It offers a variety of desktop environments, including IceWM and Fluxbox, which are very light on resources.

  7. Puppy Linux: Extremely lightweight and fast, Puppy Linux is designed to run on older systems with minimal resources. It can be run from a USB stick and is a great option if you need something super light.

  8. MX Linux: A bit heavier than the others on this list, but still lightweight compared to mainstream distros. MX Linux offers a balance between performance and features, using the Xfce desktop environment.

All of these distros should run well on older hardware, but the best one for you will depend on your specific needs and preferences. If you want a familiar environment with good support, Lubuntu or Xubuntu are great choices. If you need something ultra-lightweight, go for Puppy Linux or AntiX.

jenom1957 commented 1 month ago

I am not familiar with ZADIG, it runs on a Windows PC, correct?.......if so let's stay with Windows I can see on github page: "Windows support by setting the driver to WinUSB using Zadig" Already downloaded and installed Zadig....installed "scoop" to install "pipx". Also installed Python3.12.3. Then with pipx installed labelle. However, got "Failed scanning devices: No backend available" error below is the screenshot for all the messages:

PS C:\Users\Administrator.local\bin> .\labelle "Hello World" ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ C:\Users\Administrator\pipx\venvs\labelle\Lib\site-packages\labelle\lib\devices\device_manager.p │ │ y:34 in scan │ │ │ │ 31 │ def scan(self) -> bool: │ │ 32 │ │ prev = self._devices │ │ 33 │ │ try: │ │ ❱ 34 │ │ │ cur = {dev.hash: dev for dev in UsbDevice.supported_devices() if dev.hash} │ │ 35 │ │ except POSSIBLE_USB_ERRORS as e: │ │ 36 │ │ │ self._devices.clear() │ │ 37 │ │ │ raise DeviceManagerError(f"Failed scanning devices: {e}") from e │ │ │ │ ╭──────────────────────────────────────── locals ─────────────────╮ │ │ │ prev = {} │ │ │ │ self = <labelle.lib.devices.device_manager.DeviceManager object at 0x000001CD7AFCD5E0> │ │ │ ╰──────────────────────────────────────────────────────────────────╯ │ │ │ │ C:\Users\Administrator\pipx\venvs\labelle\Lib\site-packages\labelle\lib\devices\usb_device.py:99 │ │ in supported_devices │ │ │ │ 96 │ def supported_devices() -> set[UsbDevice]: │ │ 97 │ │ return { │ │ 98 │ │ │ UsbDevice(dev) │ │ ❱ 99 │ │ │ for dev in usb.core.find( │ │ 100 │ │ │ │ find_all=True, custom_match=UsbDevice._is_supported_vendor │ │ 101 │ │ │ ) │ │ 102 │ │ } │ │ │ │ C:\Users\Administrator\pipx\venvs\labelle\Lib\site-packages\usb\core.py:1309 in find │ │ │ │ 1306 │ │ │ │ _logger.info('find(): using backend "%s"', m.name) │ │ 1307 │ │ │ │ break │ │ 1308 │ │ else: │ │ ❱ 1309 │ │ │ raise NoBackendError('No backend available') │ │ 1310 │ │ │ 1311 │ if find_all: │ │ 1312 │ │ return device_iter(**args) │ │ │ │ ╭─────────────────────────────────────────── locals ─────────────────╮ │ │ │ args = {} │ │ │ │ backend = None │ │ │ │ custom_match = <function UsbDevice._is_supported_vendor at 0x000001CD7A215620> │ │ │ │ device_iter = <function find..device_iter at 0x000001CD7B03BCE0> │ │ │ │ find_all = True │ │ │ │ libusb0 = <module 'usb.backend.libusb0' from │ │ │ │ 'C:\Users\Administrator\pipx\venvs\labelle\Lib\site-packages\usb\ba… │ │ │ │ libusb1 = <module 'usb.backend.libusb1' from │ │ │ │ 'C:\Users\Administrator\pipx\venvs\labelle\Lib\site-packages\usb\ba… │ │ │ │ m = <module 'usb.backend.libusb0' from │ │ │ │ 'C:\Users\Administrator\pipx\venvs\labelle\Lib\site-packages\usb\ba… │ │ │ │ openusb = <module 'usb.backend.openusb' from │ │ │ │ 'C:\Users\Administrator\pipx\venvs\labelle\Lib\site-packages\usb\ba… │ │ │ ╰────────────────────────────────────────────────────────────────── NoBackendError: No backend available

The above exception was the direct cause of the following exception:

╭─────────────────────────────── Traceback (most recent call last) ────────────────╮ │ C:\Users\Administrator\pipx\venvs\labelle\Lib\site-packages\labelle\cli\cli.py:507 in default │ │ │ │ 504 │ ) │ │ 505 │ │ │ 506 │ if output == Output.PRINTER: │ │ ❱ 507 │ │ device_manager = get_device_manager() │ │ 508 │ │ device = device_manager.find_and_select_device(patterns=device_pattern) │ │ 509 │ │ device.setup() │ │ 510 │ else: │ │ │ │ ╭─────────────────────────────────────────── locals ────────────────╮ │ │ │ align = <Direction.LEFT: 'left'> │ │ │ │ barcode_content = None │ │ │ │ barcode_text = None │ │ │ │ barcode_type = None │ │ │ │ barcode_with_text_content = None │ │ │ │ ctx = <click.core.Context object at 0x000001CD7A9E2B40> │ │ │ │ device_pattern = None │ │ │ │ fixed_length = None │ │ │ │ font = None │ │ │ │ font_path = WindowsPath('C:/Users/Administrator/pipx/venvs/labelle/Lib/site… │ │ │ │ font_scale = 90.0 │ │ │ │ frame_width_px = None │ │ │ │ imagemagick = False │ │ │ │ justify = <Direction.LEFT: 'left'> │ │ │ │ margin_px = 56.0 │ │ │ │ max_label_mm_len = None │ │ │ │ max_length = None │ │ │ │ max_payload_len_px = None │ │ │ │ min_label_mm_len = 0.0 │ │ │ │ min_length = 0.0 │ │ │ │ min_payload_len_px = 0 │ │ │ │ old_align = None │ │ │ │ old_barcode = None │ │ │ │ old_font = None │ │ │ │ old_frame = False │ │ │ │ old_help = False │ │ │ │ old_justify = None │ │ │ │ old_margin = None │ │ │ │ old_min_length = None │ │ │ │ old_picture = None │ │ │ │ old_style = None │ │ │ │ old_tape_size = None │ │ │ │ output = <Output.PRINTER: 'printer'> │ │ │ │ picture = None │ │ │ │ preview = False │ │ │ │ preview_inverted = False │ │ │ │ qr_content = None │ │ │ │ render_engines = [ │ │ │ │ │ <labelle.lib.render_engines.text.TextRenderEngine object at │ │ │ │ 0x000001CD7A945F40> │ │ │ │ ] │ │ │ │ scale = None │ │ │ │ style = <FontStyle.REGULAR: 'regular'> │ │ │ │ tape_size_mm = None │ │ │ │ test_pattern = None │ │ │ │ text = ['Hello World'] │ │ │ │ verbose = False │ │ │ │ version = None │ │ │ ╰───────────────────────────────────────────────────────────╯ │ │ │ │ C:\Users\Administrator\pipx\venvs\labelle\Lib\site-packages\labelle\cli\cli.py:83 in │ │ get_device_manager │ │ │ │ 80 def get_device_manager() -> DeviceManager: │ │ 81 │ device_manager = DeviceManager() │ │ 82 │ try: │ │ ❱ 83 │ │ device_manager.scan() │ │ 84 │ except DeviceManagerNoDevices as e: │ │ 85 │ │ err_console = Console(stderr=True) │ │ 86 │ │ err_console.print(f"Error: {e}") │ │ │ │ ╭─────────────────────────────────────────── locals ───────────────────╮ │ │ │ device_manager = <labelle.lib.devices.device_manager.DeviceManager object at │ │ │ │ 0x000001CD7AFCD5E0> │ │ │ ╰──────────────────────────────────────────────╯ │ │ │ │ C:\Users\Administrator\pipx\venvs\labelle\Lib\site-packages\labelle\lib\devices\device_manager.p │ │ y:37 in scan │ │ │ │ 34 │ │ │ cur = {dev.hash: dev for dev in UsbDevice.supported_devices() if dev.hash} │ │ 35 │ │ except POSSIBLE_USB_ERRORS as e: │ │ 36 │ │ │ self._devices.clear() │ │ ❱ 37 │ │ │ raise DeviceManagerError(f"Failed scanning devices: {e}") from e │ │ 38 │ │ if len(cur) == 0: │ │ 39 │ │ │ self._devices.clear() │ │ 40 │ │ │ raise DeviceManagerNoDevices("No supported devices found") │ │ │ │ ╭──────────────────────────────────────── locals ─ │ │ │ prev = {} │ │ │ │ self = <labelle.lib.devices.device_manager.DeviceManager object at 0x000001CD7AFCD5E0> │ │ │ ╰────────────────────────────────────────------------------------------------------- DeviceManagerError: Failed scanning devices: No backend available

Do you have any suggestion ? My Dymo printer is connected and ready, Model Label Writer 450 ? Thanks!

maresb commented 1 month ago

My Dymo printer is connected and ready, Model Label Writer 450 ?

Ah, this is new information. Unfortunately we have no confirmed reports yet that Dymoprint/Labelle works with the 450. Please see https://github.com/labelle-org/labelle/issues/4 for compatibility information.

Regarding the error message

DeviceManagerError: Failed scanning devices: No backend available

it seems to indicate that you have not yet used Zadig. Could you please attach a screenshot from Zadig with your Label Writer 450 set to WinUSB?