Epson Escape Code for Landscape Orientation

Question:

I have an Epson Stylus Color 600. Epson tells me the Escape Codes are exactly the same as the LQ-850, and others of that line. I have a really old document that I maintain in PFS: Professional Write, an old DOS word processor, but the word processor doesn't natively support landscape mode. What I've done previously, with HP printers, is to pass the escape codes to the printer before the document (PFS allows you to do this). With the HP printer, I just sent the codes to select 8.5" by 14" paper, and a font (Courier) that was in landscape orientation. I'm wondering do you know which Escape Codes for the Epson printers will do this same thing? Any help is greatly appreciated!

Answer:

Nope. Can't do it.

According to Epson Tech Support, no escape code for landscape mode exists, and the printer has to be in graphics mode in order to rotate the image for landscaping. Also, Epson Tech Support recommends software packages like  SideWays or AllWays. Well, this does work, but the problem is that they produce terrible print quality (it looks like dot matrix print on my ink jet printer).

Some Solutions

The following solutions can be used by themselves or in combination to solve most of the problems printing documents created by DOS applications.

If you can use another software application to manage the DOS text files, then get a Windows text editor like TextPad.

I strongly recommend using a Windows text editor. It is the quickest, easiest, and most efficient way to manage and maintain text files in Windows. With a good fixed-pitch font you can both view and print any DOS text file.

If you are just printing a plain report from an application where no document exists then redirect printer output to a file, load the file, and print it.

The old DOS utility prn2file.com works very well for capturing printer output and redirecting it to a file. NetWare's CAPTURE statement can also capture to a file, but the file must be located on a NetWare volume. Load the file into a word processor, set the page orientation, select all, change to a fixed-pitch font (like courier new), reduce the font size to 8 or 9, if necessary reduce the line spacing, and print. Macros work well for this. A Windows text editor is the better solution because no changes to the output file will be needed. Open the file, change the page orientation in printer setup, and print.

Note, Windows also comes with a Generic/Text Only print driver that I have yet to get DOS applications to use. This is why I keep prn2file.com around even though it is very old DOS software.

If you are printing a landscape report from an application and don't care about the page orientation, you can print directly to the printer by condensing the font size.

You could send the printer escape sequences (codes) for 12 characters per inch (cpi) and condensed (17 cpi) to the printer before printing. This would give you 20 cpi. In other words, you could fit 160 characters per line (cpl) from left edge to right edge of the printed page. Condensing the font size allows you to reduce the report's width in order to print without line wrapping or cutoff.

Depending on the printer margin settings you may lose the last few characters of a report. For instance, on a Brother MFC-7000, the cpl was 129. Two more characters than what was needed to print a report. You can also change the margin settings before printing by sending the proper codes.

If the word processor or editor supports inserting extended codes, you can embed the codes right into the document.

This was a technique I would use with source code listings before the days of Windows printing and before I started to use TextPad. If you are using an old DOS word processor, embedding the printer escape sequences (codes) might be a good solution. For instance, most programming editors supported the insertion of extended characters. Printer codes are just a combination of extended characters. Right before each procedure, I would insert a comment followed by a form feed code and the double strike (bold) code. After the procedure, I would insert another comment that would insert the code to turn double strike off. When I printed the source code listing, each procedure started at the beginning of a page and the name, parameters, and return values were bolded.

For existing document, insert any needed codes into you document. For application reports, output to a file and insert the codes into the file before printing.

If the software application outputs codes along with the report data you must output the report to a file and remove the codes.

Some old DOS application included printer escape sequences (codes) with the report data in order to control the printer and format the report. This problem is the most difficult to deal with. Typically, you must output the report to a file, load the file into a Windows word processor or text editor, and format the report to either eliminate or add codes in order for the report to print properly.

For instance, an application assumed it would always use a HP printer. The programmer hard-coded the printer escape sequences into the application and there was no way to change it. Everyone was afraid to get rid of the printer because they still needed to print reports. To make matters worse the printer had to be installed on the computer's printer port. Which mean only one person could print reports. A real pain. To solve the problem, a batch file was created that captured all printer port activity to a file. A Microsoft Word macro was created that opened this file, removed the HP specific codes, inserted the proper codes for printing, adjusted the page orientation, and printed the report. Now everyone can print whatever report they need, to any printer, whenever they want.

Extended ASCII Characters

Now let us talk about the extended ASCII characters and the problem of converting documents from DOS to Windows. The extended character set allowed us to use copyright, trademark, lines, boxes, graphics, equation, and other symbols. Some characters were used sparingly and can be easily replaced or updated when converting. Some common characters are supported in the True-Type fonts installed and need no conversion. Yet, other characters where used so much that converting a document can be tedious. I am talking about those extended ASCII characters used to form lines, boxes, and other graphics. Many writers included included these characters in technical documentation. Software developers would capture the screen text and insert it into the software's user manual. Hard drive manufacturers would draw the drive, the location of jumpers, and how the jumpers were to be set. These "graphic" characters are the main problem during conversion.

Documents with these extended characters require manual formatting in order to convert them successfully. Microsoft first introduced the True-Type font MS LineDraw to help with the conversion. This was a fixed-pitch font that included all the original ASCII and extended ASCII character set (except for characters below decimal value 32). Later, Microsoft provided the True-Type fixed-pitch font Courier New. Seagate has Letter Gothic Line True-Type font. This font is yet another fixed-pitch font containing the line characters used in their on-line hard drive specifications. They recommend that you down load the font, because it is easier for you to install a special font for viewing then it is for them to update all their documentation.

Converting files from DOS to Windows

  • Which leads us to converting DOS text files to Windows word processing documents. If you don't care about what word processor or text editor you use, the easiest and best results can be obtained with a windows text editor called TextPad and four fonts: Terminal, MS LineDraw, Courier New, and Letter Gothic Line. The true-type font MS LineDraw will produce the best results of the four fonts when used with a Windows text editor. The true-type font Courier New will produce the best results of the four fonts when used with a Windows word processor.

MS LineDraw was originally installed by default in Office 4.2. I believe it was shipped with Office 95, but not Office 97. Microsoft replaced MS LineDraw with a true-type font called Courier New that supports The Unicode Standard Box Drawing Symbols.  Letter Gothic Line and terminal will work, but the characters are not as clean as in MS LineDraw and Courier New.

With TextPad, no converting is needed. You can both view and print with the font of your choosing. Using a good Windows text editor is by far the quickest and easiest way to go.

  • The best long-term solution would be to convert the DOS text file into a Windows word processor file format in use, and convert any characters to their Unicode equivalent. One benefit of this would be the ability to embed the fonts used to create the document into the files. Also, you would only need one application to manage the files. That is a disadvantage of using TextPad. You still need a separate application to edit them.

Converting Overview

Quick run down of what is needed, if you want to convert the files into a word processor:

  1. Change the page layout
  2. Change the font to Courier New
  3. Reduce the font size.
  4. Search and replace the characters.
  5. Change the line spacing, if needed.

Conversion Macros

The macro ConvertDOSOEM_to_CourierNew does a search and replace for some of the more common extended ASCII characters and replaces them with their equivalent Unicode Box Drawing Symbols. The macro MakeBoxDrawingUnicodeChart creates a chart to help with converting. I do not support these macros in any way. They worked for my needs, and are provided only for your information. Also, check out the Word macros that are installed with Word for findsymbol and ascvalue.

  • The file dos2win.doc contains other related information that you may find useful.

References

 

TextPadTo get more information and download TextPad visit http://www.textpad.com. The editor is shareware and inexpensive. Well worth the price, and the latest version support Unicode.

To get MS LineDraw and more information review Microsoft Article ID Q96040 at http://support.microsoft.com/support/kb/articles/q96/0/40.asp. I do not think it is available, but I think I know where to get it.

To get Letter Gothic Line download ftp://ftp.seagate.com/techsuppt/letgothl.zip.

The Unicode Standard can be found at http://www.unicode.org.

EPSON ESCAPE CODES

Here are some Epson Escape Codes, otherwise known by Epson as ESC or ESC/P2.

Commands sent to the printer while printing a document are generally known as printer escape sequences, because the escape character must come before any character you don't want to print. This is generally true except for non-printable characters. These are the characters below the decimal number 32. For instance, the code BEL does not need ESC to be sent to the printer first because you can't print a sound. To toggle underlining you must send ESC before the hyphen; otherwise, the printer is just going to print a hyphen.

Some codes require a parameter to be sent, this should immediately follow the code. For example, to set the line spacing to 20/180 inches use 27 51 20. The decimal value for ESC is 27 and the hex value is 1B, 51 is the decimal value for the code 3, and 20 is the decimal value for the line spacing parameter.

For on/off commands, 1=on, 0=off.

Epson LQ-2500 Printer Codes

Code DEC HEX Effect
BEL 7 07 Sound beeper
HT 9 09 Tab Horizontally
VT 11 0B Tab Vertically
CR 13 0D Carriage Return
SI 15 0F Select condensed printing
DC2 18 12 Cancel condensed printing
CAN 24 18 Cancel line
ESC SO 14 0E Select double-width printing (one line)
ESC EM 25 19 Cut-sheet feeder control
ESC ! 33 21 Master style select command
ESC $ 36 24 Set absolute dot position
ESC & 38 26 Define user-defined characters
ESC - 45 2D Turn underlining on/off
ESC 0 48 30 Select 1/8th inch line spacing
ESC 3 51 33 Select n/180 inch line spacing
ESC 5 53 35 Cancel italic characters
ESC 7 55 37 Cancel printable area expansion
ESC < 60 3C Uni-directional printing for one line
ESC > 61 3D Set eighth bit of incoming data
ESC @ 64 40 Initialize printer
ESC B 66 41 Set vertical tabs
ESC D 68 44 Set horizontal tabs
ESC F 70 46 Cancel emphasized printing
ESC H 72 48 Cancel emphasized printing
BS 8 08 Backspace
LF 10 0A Line Feed
FF 12 0C Form Feed
SO 14 0E Select double-width printing for one-line
DC1 17 11 Select Printer (Online)
DC4 20 14 Cancel double-width printing
DEL 127 7F Delete character
ESC SI 15 0F Select condensed printing
ESC SP 32 20 Set inter-character space
ESC # 35 23 Cancel eighth bit
ESC % 37 25 Turn user-defined character set on/off
ESC * 42 2A General bit-image command
ESC / 47 25 Select vertical tab channel
ESC 2 50 32 Select 1/6th line spacing
ESC 4 52 34 Select italic characters
ESC 6 54 36 Expand printable area
ESC : 58 3A Copy ROM character set into user-defined characters
ESC =     Clear eighth bit of incoming data
ESC ? 63 3F Re-assign bit image commands
ESC A 65 41 Set n/60th inch line spacing
ESC C 67 43 Set page length in lines
ESC E 69 45 Select emphasized printing
ESC G 71 47 Select double-strike printing
ESC J 74 4A Perform n/180 inch line feed
ESC L 76 4C Select 8-bit double density bit image printing
ESC N 78 4E Set bottom margin
ESC P 80 50 Select 10-pitch characters
ESC R 82 52 Select international character set
ESC T 84 54 Cancel superscript/subscript mode
ESC W 87 57 Turn double width printing on/off
ESC Z 90 5A Elect 8-bit double speed double density bit image printing
ESC b 98 62 Set vertical tabs in channels
ESC k 107 6B Select font family
ESC p 112 70 Proportional characters on/off
ESC s 115 73 Turn half-speed mode on/off
ESC x 120 78 Select LQ or Draft
ESC K 75 4B Select 8-bit single density bit image printing
ESC M 77 4D Select 12-pitch characters
ESC O 79 4F Cancel bottom margin
ESC N 78 4E Set right margin
ESC S 83 53 Select superscript/ subscript mode
ESC U 85 55 Turn uni-directional printing on/off
ESC Y 89 59 Select 8-bit double speed double density bit image printing
ESC a 97 61 Set justification mode
ESC g 103 67 Select 15-pitch chars
ESC l 108 6C Set left margin
ESC r 114 72 Select printing color
ESC t 116 74 Select character table
ESC \ 92 5C Set relative dot position

Escape Codes LQ-510

ASCII DEC HEX Description
BEL 7 07 Beeper
BS 8 08 Backspace
HT 9 09 Tab horizontally
LF 10 0A Line feed
VT 11 0B Tab vertically
FF 12 0C Form feed
CR 13 0D Carriage return
SO 14 0E Select double-wide mode (one line)
SI 15 0F Select condensed mode
DC1 17 11 Select printer
DC2 18 12 Cancel condensed mode
DC3 19 13 Deselect printer
DC4 20 14 Cancel double-wide mode (one line)
CAN 24 18 Cancel line
DEL 127 7F Delete character
ESC SO 14 0E Select double-wide mode (one line)
ESC EM 25 19 Control cut sheet feeder
ESC SP 32 20 Set inter-character space
ESC ! 33 21 Master select
ESC # 35 23 Cancel MSB control
ESC $ 36 24 Set absolute print position
ESC % 37 25 Select user-defined set
ESC & 38 26 Define user-defined characters
ESC (- 40 28 Select score
ESC * 42 2A Select graphics mode
ESC + 43 2B Set n/360-inch line spacing
ESC - 45 2D Turn underline mode On/Off
ESC / 47 2F Select vertical tab channel
ESC 0 48 30 Select 1/8-inch line spacing
ESC 2 50 32 Select 1/6-inch line spacing
ESC 3 51 33 Select 1/180-inch line spacing
ESC 4 52 34 Select italic mode
ESC 5 53 35 Cancel italic mode
ESC 6 54 36 Enable printer characters
ESC 7 55 37 Enable upper control codes
ESC : 58 3A Copy ROM to RAM
ESC < 60 3C Select unidirectional mode (one line)
ESC = 61 3D Set MSB to 0
ESC > 62 3E Set MSB to 1
ESC ? 63 3F Reassign graphics mode
ESC @ 64 40 Initialize printer
ESC U 85 55 Turn unidirectional mode On/Off
ESC W 87 57 Turn double-wide mode On/Off
ESC Y 89 59 Select high-speed double-density graphics mode
ESC Z 90 5A Select quadruple-density graphics mode
ESC \ 92 5C Set relative print position
ESC a 97 61 Select justification
ESC b 98 62 Set vertical tabs in channels
ESC g 103 67 Select 15 cpi
ESC k 107 6B Select typestyle family
ESC l 108 6C Set left margin
ESC p 112 70 Turn proportional mode On/Off
ESC q 113 71 Select character style
ESC t 116 74 Select character table
ESC w 119 77 Turn double-high mode On/Off
ESC x 120 78 Select letter quality or draft

Escape Codes LQ-850

ASCII DEC HEX Description
BEL 7 07 Beeper
BS 8 08 Backspace
HT 9 09 Tab horizontally
LF 10 0A Line feed
VT 11 0B Tab vertically
FF 12 0C Form feed
CR 13 0D Carriage return
SO 14 0E Select double-wide (1 line)
SI 15 0F Select condensed mode
DC1 17 11 Select printer
DC2 18 12 Cancel condensed mode
DC3 19 13 Deselect printer
DC4 20 14 Cancel double-wide (1 line)
CAN 24 18 Cancel line
DEL 127 7F Delete character
ESC SO 14 0E Select double-wide (1 line)
ESC SI 15 0F Select condensed mode
ESC EM 25 19 Cut sheet feeder on/off
ESC SP 32 20 Set inter character space
ESC ! 33 21 Master select
ESC # 35 23 Cancel MSB control
ESC $ 36 24 Set absolute print position
ESC % 37 25 Select user-defined set
ESC & 38 26 Define user-defined characters
ESC (- 40 28 Select Score
ESC * 42 2A Select graphics mode
ESC + 43 2B Set n/360-inch Line Spacing
ESC - 45 2D Turn underlining on/off
ESC / 47 2F Select vertical tab channel
ESC 0 48 30 Select 1/8-inch line spacing
ESC 2 50 32 Select 1/6-inch line spacing
ESC 3 51 33 Select n/216-inch line spacing
ESC 4 52 34 Select italic mode
ESC 5 53 35 Cancel italic mode
ESC 6 54 36 Enable printable characters
ESC 7 55 37 Enable upper control codes
ESC : 58 3A Copy ROM into RAM
ESC < 60 3C Unidirectional mode (1 line)
ESC > 62 3E Set MSB to 1
ESC ? 63 3F Reassign graphics mode
ESC @ 64 40 Initialize printer
ESC A 65 41 Set n/72-inch line spacing
ESC B 66 42 Set vertical tabs
ESC C 67 43 Set page length in lines
ESC C0 67 43 Set page length in inches
ESC D 68 44 Set horizontal tabs
ESC E 69 45 Select emphasized mode
ESC F 70 46 Cancel emphasized mode
ESC G 71 47 Select double-strike mode
ESC H 72 48 Cancel double-strike mode
ESC J 74 4A Perform n/216-inch line feed
ESC K 75 4B Select single-density graphics
ESC L 76 4C Select double-density graphics
ESC M 77 4D Select 12 cpi
ESC N 78 4E Set skip over perforation
ESC O 79 4F Cancel skip over perforation
ESC P 80 50 Select 10 cpi
ESC Q 81 51 Set right margin
ESC R 82 52 International character set
ESC S0 83 53 Select superscript mode
ESC S1 83 53 Select subscript mode
ESC T 84 54 Cancel superscript/subscript
ESC U 85 55 Turn unidirectional mode on/off
ESC W 87 57 Turn double-wide on/off
ESC Y 89 59 High-speed double-density graphics
ESC Z 90 5A Quadruple-density graphics
ESC \ 92 5C Retrieve relative position
ESC a 97 61 Select justification
ESC b 98 62 Set vertical tabs in channels
ESC g 103 67 Select 15 CPI
ESC k 107 6B Select typestyle family
ESC l 108 6C Set left margin
ESC p 112 70 Turn proportional mode on/off
ESC q 113 71 Select character style
ESC t 116 74 Select character table
ESC w 119 77 Turn double-high on/off
ESC x 120 78 Select NLQ or draft

Escape Codes X-810

ASCII DEC HEX Description
BEL 7 07 Beeper
BS 8 08 Backspace
HT 9 09 Tab horizontally
LF 10 0A Line feed
VT 11 0B Tab vertically
FF 12 0C Form feed
CR 13 0D Carriage return
SO 14 0E Select double-wide mode (one line)
SI 15 0F Select condensed mode
DC1 17 11 Select printer
DC2 18 12 Cancel condensed mode
DC3 19 13 Deselect printer
DC4 20 14 Cancel double-wide mode (one line)
CAN 24 18 Cancel line
DEL 127 7F Delete character
ESC SO 14 0E Select double-wide mode (one line)
ESC EM 25 19 Control cut sheet feeder
ESC ! 33 21 Master select
ESC % 37 25 Select user-defined set
ESC & 38 26 Define user-defined characters (draft and LQ)
ESC * 42 2A Select graphics mode
ESC - 45 2D Turn underline mode On/Off
ESC / 47 2F Select vertical tab channel
ESC 0 48 30 Select 1/8-inch line spacing
ESC 1 49 31 Select 7/72-inch line spacing
ESC 2 50 32 Select 1/6-inch line spacing
ESC 3 51 33 Select 1/180-inch line spacing
ESC 4 52 34 Select italic mode
ESC 5 53 35 Cancel Italic mode
ESC 6 54 36 Enable printer characters
ESC 7 55 37 Enable upper control codes
ESC 8 56 38 Disable paper out detection
ESC 9 57 39 Enable paper out detection
ESC : 58 3A Copy ROM to RAM
ESC < 60 3C Select unidirectional mode (one line)
ESC ? 63 3F Reassign graphics mode
ESC @ 64 40 Initialize printer
ESC A 65 41 Set n/60-inch line spacing
ESC B 66 42 Set vertical tabs
ESC C 67 43 Set page length in inches
ESC C0 67 43 Set page length in inches
ESC D 68 44 Set horizontal tabs
ESC E 69 45 Select emphasized mode
ESC F 70 46 Cancel emphasized mode
ESC G 71 47 Select double-strike mode
ESC H 72 48 Cancel double-strike mode
ESC J 74 4A Perform n/180-inch line feed
ESC K 75 4B Select single-density graphics mode
ESC L 76 4C Select double-density graphics mode
ESC M 77 4D Select 12 cpi
ESC N 78 4E Set skip over perforation
ESC O 79 4F Cancel skip over perforation
ESC P 80 50 Select 10 CPI
ESC Q 81 51 Set right margin
ESC R 82 52 Select International character set
ESC S0 83 53 Select superscript mode
ESC S1 84 54 Select subscript mode
ESC T 85 55 Deselect superscript/subscript mode
ESC U 85 55 Turn unidirectional mode On/Off
ESC W 87 57 Turn double-wide mode On/Off
ESC Y 89 59 Select high-speed double-density graphics mode
ESC Z 90 5A Select quadruple-density graphics mode
ESC ^ 94 5E Select 9-pin graphics mode
ESC a 97 61 Select justification
ESC b 98 62 Set vertical tabs in channels
ESC e 101 65 Set tab increments
ESC f 102 66 Horizontal/vertical skip
ESC k 107 6B Select type style family
ESC l 108 6C Set left margin
ESC s 115 73 Turn half-speed mode On/Off
ESC t 116 74 Select character table
ESC x 120 78 Select letter quality or draft
Created: 26 Oct 2001 01:39:54 -0700
Changed: 22 Dec 2005 18:05:47 -0800

Take Pride in America

envelope indicating e-mail address ton_y*missico.com