Printing a string correctly
Posted
#1
(In Topic #1076)
Enthusiast

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)
- WAGG MEATY GOODNESS
- ADULT COMPLETE BEEF
- DINNER 12KG
NOT
Code (gambas)
- WAGG MEATY GOODNESS AD
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
Posted
Guru

EDIT 05/08/23
It would be helpful to know what size label you are wanting to print on. (e.g. 50x25mm)
Posted
Guru

There are a few methods mentioned from text adjusting to making a text image.
See here… https://forum.gambas.one/viewtopic.php?t=1576
1 guest and 0 members have just viewed this.



