Printing a string correctly

Post

Posted
Rating:
#1 (In Topic #1076)
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
Hi Everyone

I was hoping someone could help me

I am at the moment working on migrating one of my Windows application to Gambas3

This application prints Labels on a Zebra LP2824 Printer (Networked - Also would like some help on how to print to the networked printer)

What it does it it will access a database field called SELDescription (this can be up to 125 chrs long) and it would split it so it will print correctly.

The label on the Printer has 5 lines of 25 chrs per line

what i need help with is how to go it so the label looks correct

Say I have this in the database "WAGG MEATY GOODNESS ADULT COMPLETE BEEF DINNER 12KG"

I need to print the label like

Code (gambas)

  1. WAGG MEATY GOODNESS
  2. ADULT COMPLETE BEEF
  3. DINNER 12KG
  4.  

NOT

Code (gambas)

  1. WAGG MEATY GOODNESS AD
  2.  

I have all the code I need to make the label print correctly I just need help in splitting the Database Field up so I can have full words on the lines (and use up to 5 lines if needed)

is someone could point me in the correct direction or even better is someone has some example code that would be great

Thank in advance
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Guru
cogier is in the usergroup ‘Guru’
Check out the last post in this section A challenge for you. Also see if lpstat -p -d on the command line sees your printer.

EDIT 05/08/23
It would be helpful to know what size label you are wanting to print on. (e.g. 50x25mm)
Online now: No Back to the top

Post

Posted
Rating:
#3
Guru
BruceSteers is in the usergroup ‘Guru’
Yep we just had this same conversation.

There are a few methods mentioned from text adjusting to making a text image.

See here… https://forum.gambas.one/viewtopic.php?t=1576
Online now: No Back to the top
1 guest and 0 members have just viewed this.