Creating HTML Screenshots from Thomas Dickey's XFree86 XTerm


(At the time of this writing, a terminalemulator-independent solution, using OCR with perl's Image::Magick, can be found at Christoph Biedl's page.)

But here is a solution converting direct output from the print action of Thomas Dickey's xterm, i.e., the XFree86 xterm..

You need:

In the following there are "screenshots" listed from

And by the way:


With HTML 3.2 tables (here with empty header line) and bgcolor attributes in table cells:

(IMHO opera-5b1(SunOS) and -6tp2(Linux) are not really accurate in table rendering. You might get better results by choosing a normal font not bigger than size 10, because opera uses a normal font even for the monospaced <tt> rendering (how strange). This might also be the reason, why opera needs a table header. Even then the results are far from perfect for me. (If every character got its own table cell, which would result in really huge files, then opera might render better.)

With HTML 4.01 <span> tags:

(In opera i get thin horizontal gaps between the rows.)

In some browsers (netscape 4.7, early mozillas) span tags are rendered markedly faster. But in some browsers, minimal variations of the line length are visible.

And for the sake of completeness screenshots in png format:

The original xterm dumps:


About the "Alternate linedrawing characters":

This might only work on Unix, only with some browsers, definitely only with an appropriate font. Here's a test for the 12 (from 15) probably displayable characters:
Configure e.g. (Sony-)"Fixed"(-Misc). as fixed-width (or probably monospaced) font in your browser: Size 10 is fine.

A small screen shot (gif) while using a proper fixed-width font.
It looks like this on Unix in netscape-2.0, netscape-4.7, mozilla-1.3 and opera-5b1/6tp2:
    ""

Your browser (using the <tt> tag in an HTML 3.2 table)
    ""

Your browser (using <pre> and HTML 4.01 <span> tags)

    ""

(My opera version refuses to display the last character, "&#25;". Well it's illegal, anyway...)


Options for the script:

options:
  -h[elp]          : this help
  -width <x>       : width of xterm
  -linedrawing <x> : 0 - don't try to show alternate linedrawing characters
                     1 - try to show them
                     2 - show the original plain characters (without sense)
  -fg <color>      : xterm foreground color
  -bg <color>      : xterm background color
  -spantags        : do not use HTML 3.2+ tables but HTML 4.01 <span> tags
  -htmlcolors      : don't use original xterm colors but HTML color names
                     (more dim, though)
  -noheader        : don't insert a table header (opera needs it)
  -spacing         : table cellspacing, to debug bad rendering (e.g. for opera)