11

I have many GWBasic programs peppered with Epson-specific escape sequences (ESC/P). Unfortunately I no longer have any printers that support these escape sequences.

Is there any way I can convert these programs to a more usable format whilst preserving the formatting described by the escape sequences? [![esc\p codes

  • 1
    Welcome to Retrocomputing Stack Exchange. You've come to the right place, but at present your question is worded a bit like a support request. I'll have a go at editing it; please read the tour whilst you're waiting. If my edit conflicts with your question feel free to roll it back by clicking on the "edited: time times ago" blue text that appears above. – wizzwizz4 May 9 '17 at 18:15
  • Anyone who knows PostScript might want to give a converter a try - here's a ESC/P-83 specification. – wizzwizz4 May 9 '17 at 18:31
13

If you can get your output to a file using redirection, then you can use the Linux open-source project called dotprint to convert the file into a PDF document for printing on a modern printer, viewing on-screen, or transmitting.

From the dotprint README:

dotprint is a tool that can be used to convert text files that include escape sequences for dot matrix printers into PDF files. Nowadays you are not likely to come across such files often but they were common in the "bad old days" of DOS. Programs would often assume an "epson-compatible" dot matrix printer and would embed the escape sequences (for e.g. condensed or expanded font) into the output.

The source code and instructions are on GitHub.

  • 1
    There's source code here - this code needs compiling in order to run. It's possible to compile for Windows, but considering that it requires other packages as well, compiling might be a bit hard for the average Windows user (which I assume the OP is using; Mac might be being used instead). – wizzwizz4 May 9 '17 at 19:41
  • 3
    Probably can work in Cygwin. – Brian H May 9 '17 at 22:04
  • 1
    doesn't build under gcc 6.3 and didn't understand any of the test Epson FX codes I sent it from Word 5.5. – scruss May 10 '17 at 14:25
  • @scruss Nice to see the fix is also simple. I just compiled myself on gcc 6.3. What kind of codes are you sending it? Simple stuff like bold and italic? You know it has to be in UTF8 first, right? – Brian H May 10 '17 at 21:57
  • Yup; no codes above ASCII 127. No joy. – scruss May 11 '17 at 1:32
4

I use QPCPrint (as mentioned above) on my PC, but have also released my own ESC/P2 to PDF convertor - https://github.com/RWAP/PrinterToPDF, written in C, which is designed to run on Linux

3

ESCParser (github: https://github.com/nzeemin/ukncbtl-utils/wiki/ESCParser, win32 binary: https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/ukncbtl/ESCParser.zip) converts a variant of ESC/P to PostScript and SVG.

1

You cannot expect accurate results because the basic units of these ESC/P commands depend on the printer. For example, 9-pin printers often used a basic line spacing of 1/216 inch (1/3 * 1/72), while 24-pin printers used 1/360 inch (1/5 * 1/72) instead. For the horizontal direction, the spacing may be anything from 1/60 inch to 1/360 inch, and it is printer-dependent which command selects which density. 24-pin printers often support triple and/or quadruple density modes which are completely non-standard.

So, show us the ESC/P codes in your programs and the printer they have been written for and we may be able to help you.

  • will copy escape code sequences and show soon. In the meantime the – collin Geoffrey May 9 '17 at 23:01
  • Original printer 24-pin Panasonic, and more recently Epson color 600Q – collin Geoffrey May 9 '17 at 23:02
  • have jpeg of escape codes used - how do I get it to you – collin Geoffrey May 9 '17 at 23:43
  • Just add it to your question. – Janka May 9 '17 at 23:57
  • jpeg added to original question ( I think) – collin Geoffrey May 10 '17 at 0:31
1

There is a nice (commercial, but relatively cheap) program called QPCPrint that does on-the-fly translation from Epson ESC/P escape codes received on a virtual LPT port to whatever modern printer you might have connected to your PC. This program allows you to leave the programs that were built to print to Epson printers completely unchanged and print to a modern printer.

  • My browser tells me the link is broken. – JeremyP May 10 '17 at 8:23
  • @JeremyP Funny. Works here. – tofro May 10 '17 at 8:29
  • sounds great - will investigate -- mny thks – collin Geoffrey May 10 '17 at 17:31
0

Converting the programs depends on

  1. what platform you want to run the programs on;

  2. how much of the Epson command set you depended on.

If you were doing fancy formatting relying on fixed width fonts and tabbing, that kind of formatting has mostly gone away. But if you're just doing bold and maybe centring, then outputting to HTML could be an option. The Epson's bold on/off could easily be replicated with HTML's <strong> … </strong> markup, for example.

If you're looking for a converter, epsonps is a basic Epson to PostScript filter. While it's limited it does have the advantage of being developed while dot-matrix printers were a thing, so it makes an attempt to handle most input gracefully.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.