[PAID] ESC/POS Thermal Printing extension (Bluetooth/Network)

According to a stack exchange post, try code page 28.

2 Likes
1 Like

Thank you for providing the helpful information. It seems that anyone using thermal printers is experiencing font issues, regardless of whether they have selected the correct font or not. Many languages are affected by this problem.

I am currently exploring the option of printing from images as a workaround. However, creating images tends to result in blurry prints, while generating PDF files produces clear prints but this extended functionality does not support PDF files. Do you know of any utilities or methods to convert PDF to an image for printing?

I hope @mmnettime will consider this feedback and update the application with the ability to print directly from PDF files.

I forgot to mention that AI2 uses utf-8 for its encoding.

So if your text is in a text block I would expect problems if you tell the printer to expect utf-32.

2 Likes

You can try using UTF-8 and also I see your blocks and you are using 27 as the codepage parameter. Try using a for cycle from 1 to 50 to print different outputs and check what's the correct codepage for Vietnamese on your specific printer.

The language compatibility is more of a printer issue, not necessarily the extension. In some special cases where users can't print I have added an example to print from an image. DM me the receipt of the extension purchase. And I'll send you an .aia with the image workaround

1 Like

I have sent an email to the inbox of MIT App Inventor. Please check @mmnettime

The AIA example you sent does not work. I have contacted you through the inbox, but it seems like you have been too busy to respond. @mmnettime :frowning:

How can I print text via thermal printer without breaking the words in half? What commands to use?

1 Like

Is your printer's font monospace (equal width characters)?

Here is sample code you can use to reformat the text to fit.


Sample run

(corrected 6/16/2024 for last output line omission)
text_reformatter.aia (3.9 KB)

1 Like

Thank you very much, I am also facing similar issues. After using this extension for a while, I have noticed several limitations. It seems that the author has not updated the extension for a long time, and despite my attempts to contact them, it appears that they are not interested in maintaining their extension.

Thank you very much for your attention. It works, but it cuts off the last line of text.

Thanks for the report.

I replaced the buggy version with corrected code at

This new version works well. Thank you very much!

You're welcome.

Thanks for testing!

I am aware that the extension has 1 limitation (printing an image and text on the same line, since printing an image automatically feeds a line to the printer).
There are some limitations but these are in general when working with esc/pos printers. For example, automatically knowing what paper width the printer uses, adding a new font, trying to make the content automatically fit the paper, (to achieve that you do procedures like the one user ABG just shared, but that also may not work if you are using big sized text). But as I said these are general limitations and not specific to this extension.

The extension hasn't been updated because Esc/Pos printing hasn't changed. The extension doesn't use any libraries, so it is not necessary to do updates. It only does translation of texts, images, and another commands to hex values that the printer can understand and do its job

An esc/pos printing is mostly for tickets and receipts, at least for this extension it should be. (As I already mentioned that is not compatible with label thermal printers.) And for that purpose the extension has built in everything you could possibly need. But if you need specific designs I've suggested users to create the desired content in arrangements, convert them to images using one of the existing free extensions to do that and print the resulted image using my extension.

2 Likes

Thank you very much for addressing my long-standing questions.

Is it feasible to develop additional features such as printing from PDF and printing from WebView for this extension?

Actually there's no way to directly print a PDF on ESC/POS, what it should be done is converting the pdf to an image and then print that image. It can be an addon but i haven't created it as there are extensions cretead specifically for that purpose.

The WebView thing is almost the same, from web content to pdf, from pdf to image and finally printing that image. Also it could be from webcontent to image.

In Windows usually when you print web content to an esc/pos printer the printer driver does all the conversion automatically

I'll evaluate if it is worth adding these functions to my extension.

I think you need to print pdf or webview content as you have your own method to design receipts or tickets. I think it may be helpful for you to check this extension:

You could convert PDF to image and try to print with my extension to match your desired printing results. Also webview to pdf and pdf to image as i mentioned before. Let me know if you need more help

1 Like

Thank you! With webview, we can customize and create any type of form according to our needs. The extension will be very versatile as it can print from any source.