Printing simple report to continuous roll printer

I have a windows desktop app which now needs some very simple printing to a point-of-sale printer using continuous thermal paper rolls.
I have the report working fine although my first attempt printed the header twice which indicated Xojo had inserted a page break. I then modified the printer settings (as done previously on other systems) so that the paper size is 80mm wide x 3276mm long. This time, Xojo prints the report but appears to want to feed the whole roll to the end.
I’ve checked the printer settings and although there are settings for feed and cut, these are all set to None. I’m familiar with programming for this printer from Access VBA so aware of the settings.
Am I missing something obvious in Xojo regarding it printing to the end of a ‘page’?
I’m using Xojo v2025.1.1 on Windows 11 Pro.
Thanks

You mean that when you print, the printer does its printing and then tries to feed out the entire roll of paper?

Yes, thats what it looks like

If Xojo is doing something like ‘page breaks’ that means that it will try to feed at least 3.276 meters of paper, as you defined your page that long.

I have no experience with continuous thermal printing, but I suspected that you don’t define a length size and every print length is dynamic (adding some space at start/bottom then send a ‘cut-the-paper’ signal).

1 Like

If it’s a thermal printer, they often have a protocol that lets you send bitmap images to them instead of text. You could make a picture that’s the right size and resolution draw what you need and use rgbsurface to set a threshold to make the image truly black and white.

Ah, as the other poster noted, this is the problem. Not sure why this behavior is a surprise, then - you’re asking the printer to print the entire roll. :slight_smile:

I’m guessing that you want the printer or driver to detect when the actual printing ends, and stop the printing there. Is the correct?

It is a surprise :slightly_smiling_face:
I’ve used these printers with Ms Access (on the app I’m re-coding) for about 15 years and never had this problem with the same printer settings.
Is it possible to set the page length to the actual height of the content before printing I wonder? :thinking:

Try Greg advice.

I’ve just tried the ListBox Report example with the same printer settings (Roll paper 80mm x 3276mm) and it prints just the Report, with no feeding to the end of the roll?
I’ll investigate…

2 Likes

Wait a sec.. someone check my math…

3276mm =128.976 in = 10.74 feet???

I really hope you’re not wanting to print receipts that are over 10 ft long (3.276 meters).

So… graphics objects in Xojo are limited to 32767 pixels in both X and Y. If your printer’s resolution is greater than 254ppi, you’ll exceed that height and either your printout will be clipped or it will raise an exception.

No :joy:
That’s just the paper size for the whole roll which is a standard setting on these small printers. As I said, always used that with no problem.
I’ve now abandoned using Reports completely in lieu of using DrawText etc. to formulate a print-out. (I only need a few simple print options). Everything working as expected in terms of paper feed etc. (or lack thereof). Feels a bit like I’ve gone back in time a decade or two but suits my needs at the moment!

So. You set up the printer with this very large paper size. You do a little drawing at the top of it with the usual Graphics commands and when the printer prints, you don’t get a piece of paper that matches the page setup, you get just enough paper to accommodate your drawing. Do I have that right?

If that’s the case, the printer driver is doing you a huge favor, and that’s awesome. I would wager that the report printing code is doing something like:

g.ClearRect 0, 0, g.Width, g.Height

…which is making the driver think that you are actually drawing across the entire 10 feet. :grin: