Thermal Printer paper cut

I need to send a control char to a Bematech LR2000 (continuous paper thermal printer) to cut the paper after print. I´m using a standard Clarion report.
Anyone knows how to do it?

Sorry, I don’t have an answer. I misread the question - I thought you somehow got a paper cut from a Thermal Printer… sounded painful.

Page 10 of the Bematech manual

ESC i will cut the paper
ESC m will partial cut the paper

So all you need to do is add the following code at the end of your report.

print(chr(27) & ‘i’)
print(chr(27) & ‘m’)

Thanks for answering.
I´ve tried “print(chr(27) & ‘i’)” as code but Clarion wants a report structure to print.
I´ve also put the string inside a report string, without luck (Escape gets printed as a symbol).
Do you have any other thoughts?

There is an article and example on Clarion Magazine discussing sending escape codes or other characters directly to a printer via Windows WriteFile API.
Download the PDF and take a look at Steve Parker’s article.


1 Like

Could you use the current report structure and send the code before you close the report?

I hope this helps.

Solved this way:

  • Install printer driver. It will create a USB port
  • Install a Generic Text Only printer, and point it to the same port
  • Print the report to “real” printer
  • Send codes using PrintDrv templatw to “virtual” (Generic/Text) printer.
    Works great.
1 Like

I have also been using Steven Parkers PrintDrv for years.
Works well.
Recently we had this ASCII character 132 or 0228 “ä” in the name Landäger. It would come out on the actuall Datamax Thermal printout as “õ” this being 0245 on the ascii table that is in the IDE- > toolbox -> asci table.

The documentation of the printer show that 0228 is actually “õ”. So the printer’s translation of the ascii character 0228 wins out…

Now trying to figure our how to send change/replace “extended” character from VAL(MySingleString) to ‘<132>’ considering NewLineText = ‘<’ & VAL(MySingleString) &’>’ or chr(VAL(MySingleString)) will not work.

Seems like a CASE statement will be best…
Case VAL(MySingleString)
Of 228
MySimpleChar = ‘<132>’

I doubt I am the only one. :grin: