Discussion Locked

Rich-Text Format issue (WordPad)

0 helpful
8 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have an Star SP347FC with Auto-cutter that is used for ticket printing at a Dry Cleaners. The ticket report is written in RTF (Rich-Text format) and I need to use the Generic Printer Driver to be able to use the high-speed of the printer, however, this one does not send the code for the auto-cutter. I need to insert the Auto-Cutter code at the end of the ticket report so as soon as it ends printing, the auto-cutter engages.

Now, this is the code in different formats:
Hexadecimal is '1B 64 30'
Decimal is '27 100 01'
From inside Dos Editor (EDIT) '<-d0' (the arrow is the same as holding CTRL+P and then hitting ESC inside the DOS Editor)
As written in the Printer manual: "d""0" or "d""<0>"

Does anybody know how to insert these codes in to the RTF so when the RTF interpreter reads them, they don't get ignored?
I can use the DOS Editor or WordPad to edit the ticket.

8 replies

by hmertens

(I presume a form-feed in the POS application should trigger the cutter in the specialized driver).

by javierrosado

The thing is that if we use that driver we other formatting issues. For example, when use this driver we are getting a page too long (about 22 inches in blank) when we only need to print about 6 inches of data. If we knew the RTF command tocut the page at end of the last word being printed we would have no problems with this particular suggestion.

by javierrosado

The thing is that if we use that driver we other formatting issues. For example, when use this driver we are getting a page too long (about 22 inches in blank) when we only need to print about 6 inches of data. If we knew the RTF command to cut thepage at end of the last word being printed we would have no problems with this particular suggestion.

by hmertens

Ok, can't use the printer driver (re: prev. ans.; I take it your appl' creates dynamically changing page length so you set it to longest? NB: You can set page length in RTF, if you can calculate/estimate/pre-suppose a value; or set it at the printerif constant).

Some points about RTF (another suggestion below).

To quote from http://www.st-and.ac.uk/ITS/faq/conv/formats.html
...
Rich Text Format (RTF) or Interchange Format
This is a generic format, in that it does not belong to any single proprietary word-processor. RTF files preserve the formatting information of the word-processed file, but do not rely on the non-printable control-codes used in the proprietary file formats. RTF can be used as an intermediate format when transferring between two word-processors which cannot handle each other's proprietary format.
...
(see also http://www.biblioscape.com/rtf15_spec.htm)

RTF is used to hide printer specifics. Even when you use fonts and graphics, you can not guarantee how the printer driver would deal with it (it will invoke the binary data stream modes, forcing the printer to ignore any binary patterns are esc. codes).

When you say that the "ticket report is written in RTF", I presume that application, after taking the specifics of the trx, merges the data into a document template (perhaps in RTF, or just hardwire code) and then some invokes the printer driver (VB app with Rich Textbox control (hidden?) ?).

OK, how about getting your app, after submitting the doc for printing, immediately copy this escape esc. directly to the printer port (copy /b file or exec a DOS command string). I presume this is a dedicated printer port (parallel? serial?) that is only accessed by this application. The printer doesn't care about how continuous the print stream it receives is, as long as the it isn't longer than any present auto-timed FF actions.

by javierrosado

I solved the issue by doing a combination of things:

First, I decided for using the 347 driver instead of the generic one. Then I re-formatted the document so it looked everything fine and well centralized. Then I changed the fonts to fixed-typefonts within the RTF so the printing speed gets a lot faster (non-graphics mode).

Finally I changed the Paper Type from Ticket to Receipt. This took care of the problem of the over-sized paper. Now it cuts right after it finished printing.Now, none of the answers were exactly what I was looking for, however, the second one was more concise and showed more knowledge in general about the system and about programming so I am awarding this points to you "User Deleted".

This discussion is closed to new replies.