viewfax(1)
๐ viewfax(1) โ Local commands, but make it a vibe ๐
okay bestie, sit down, hydrate, because this one's a whole mood. It's called viewfax and it lives in the local commands section of your manual, iykyk. ๐ฆ
โจ NAME โจ
viewfax โ display fax files in an X11 window ๐
๐ธ SYNOPSIS ๐ธ
viewfax [-fnluirvW24] [-hheight] [-wwidth] [-zzoom] [-ddisplay]
[-gwxh+x+y] [-bbell] [-mmemory] filename...
๐ DESCRIPTION ๐
So like, viewfax shows you one or more fax files in an X11 window. That's the whole job. It's giving "I do one thing and I slay at it." โจ
The input files can be raw, single-page faxes โ the kind a fax modem receives with a program like mgetty(1) โ or tiff files, like the ones hylafax uses. And plot twist ๐: the first (or only) page of "PC-Research"-style (DigiFAX) files made by the ghostscript dfaxhigh or dfaxlow drivers can also be displayed. Versatile queen.
Input files using any common fax encoding โ like group 3 (1 and 2 dimensional) and group 4 โ can be displayed. No cap.
The fax images get rendered at full resolution, then successively scaled down by a linear factor of 2 before display, until they fit on the screen. Like, it keeps shrinking them by half until they behave. ๐ซถ
Then you control the display interactively with mouse and keyboard commands:
- Left mouse button โ expands the image by a factor of two.
- Right mouse button โ reduces it by that same factor.
- Middle mouse button โ if the image is bigger than the available window size, this repositions it within the window. Hold the middle button down while dragging the image to its new position. ๐ฑ๏ธ
If your mouse has a scroll-wheel, it can move an oversized image vertically. Hold shift while wheeling and it scrolls through the pages instead. And the shift sense gets inverted if viewfax is started with -W on the command-line. Sneaky. ๐ญ
๐ง Further interaction = single-key commands ๐ง
horHelpโ displays a page of help information. Type'q'to return to the original document.porPriororPgUPor-orBackSpaceโ displays the previous page from the command-line list.norNextorPgDnor+or space โ displays the next page from the command-line list.Shift HOMEโ displays the first page from the command-line list.Shift ENDโ displays the last page from the command-line list.zโ zoom in (same as right mouse button).Shift Zโ zoom out (same as left mouse button).uโ turns the image upside down, which is useful if the fax was originally fed the wrong way into the machine. ๐ (we've all been there)Shift Uโ turns this and all following pages upside down.lโ turns the image through 90 degrees, to view landscape text.Shift Lโ turns this and all following pages sideways.mโ produce a left/right mirror image of the page.Shift Mโ mirror this and all following pages.- cursor arrows โ reposition the displayed image if it exceeds the window size.
HOMEโ repositions so that the top left corner is visible.ENDโ makes the bottom right corner visible.Printโ if the environment variableVIEWFAX_PRINTis defined, the current page is printed. All pages are printed withShift Print.eโ if the environment variableVIEWFAX_EDITis defined, the current page is passed to the editor. All input files can be edited withShift e.qโ terminates the program. bye bestie ๐Shift Qโ terminates the program with non-zero exit status. Can be used to abort a shell script, e.g. when the user is previewing an outbound fax and decides not to send it. Main character decision-making energy. ๐
๐ OPTIONS ๐
viewfax is designed to "do the right thing" when given just a filename. But for the special cases, we have the following options. ๐
Heads up bestie: tiff-files contain a header which overrides the-f,-n,-h,-w,-l,-m, and-uflags. The file said what it said, periodt.
-fโ indicates that raw input files are fine resolution (7.7 lines/mm) faxes. This is the default unless the filename begins with"fn". Tiff and"PC-Research"(DigiFAX) files are self-specifying.-nโ indicates that raw input files are normal resolution (3.85 lines/mm) faxes. Each fax line is duplicated in the displayed image to give approximately equal vertical and horizontal scales.-hheightโ specifies the number of fax lines. If this option is missing,viewfaxcounts the number of lines in the input file. It'll do the math for you ๐งฎ-wwidthโ specifies the number of pixels in each scan-line. The default value is1728.-lโ display in landscape mode. ๐-uโ turn the image upside down.-iโ invert pixels (black/white).-bโ preferred warning style:'a'for audible bell (console beep),'v'for visible bell (flash the window),'n'for neither.'v'is the default.-dor-displayโ use specified X server.-gor-geometryโ the preferred size and position of the window, specified aswidthxheight+x+y. If a position is given (xandyvalues),viewfaxasks the window manager to place the window there. The initial size of the window is constrained to be at mostwidthxheight.
If the window is subsequently resized due to the user zooming in or out, the geometry is taken as a constraint on the screen area which may be used by viewfax.
If you do not supply a geometry value, everything works fine with ICCCM-compliant window managers like olwm, mwm, twm, and tvtwm. When fully zoomed out the viewfax window will occupy the entire screen.
fvwm users ๐ข: you will notice that the title bar and left border are moved off screen whenviewfaxrepositions the window to(0,0). A workaround is to use-geometry +5+23when using fvwm. The proper fix would be for someone to update the routineHandleConfigureRequest()infvwm/events.cto correspond to the code intwm/events.c. (not me volunteering tho ๐ญ)
-mmemory limitโ each page is kept in memory after being fetched and expanded, which saves time if the user returns to it in the same session. To preventviewfaxfrom using all the available swap space, a limit is placed on the total size of cached images. This defaults to4 MBytes, enough for about 6 typical pages. If the memory limit is exceeded, old images are discarded and must be reloaded from disk if the user returns to them. The operation of this mechanism is transparent apart from the occasional delays due to reloading. The value specified on the command line can be suffixedkormfor kilo- or megabytes. โจ-rโ the bit order of the bytes in the input file is reversed. The fax specification deals only with serial data transmission. Modem manufacturers have to decide whether the first bit received should be placed in the most significant or the least significant position in a byte. The consensus is to pack most significant first, but the-rflag is available to deal with the opposite order. little endian/big endian drama but for bits ๐-vโ produce some informative messages (verbose mode). she's talking ๐ฃ๏ธ-zzoomโ specifies an initial zoom factor. A full-scale fax will usually not fit on the screen. If the-zoption is not specified,viewfaxscales the image by a power of 2 such that it is fully visible at a reduced size. The user can then use the mouse buttons (see above) to view expanded portions of the image.-2โ Assume that raw input files use group 3 two dimensional coding.-4โ Assume that raw input files use group 4 coding. The number of fax lines (-hoption) is required in this case. no-h, no party ๐ซ
๐ ENVIRONMENT ๐
VIEWFAX_PRINTโ Defines a command that will print one or more fax pages.VIEWFAX_EDITโ Defines a command that will calls an editor on one or more fax pages.
These two variables are optional. If a variable is undefined, the corresponding keyboard command is ignored. If the variable is defined, it should contain the name of a command or executable script that performs the desired function. The command should process a single page if called with a -p page-number argument. Alternatively, if can be called with just a list of filenames, meaning that all pages should be processed.
Here is an oversimplified example of a print command. Note that it assumes that the format is tiff and will fail when handed a raw fax file. โ ๏ธ
VIEWFAX_PRINT=printfax
/usr/local/bin/printfax:
#!/bin/sh
case "$1" in
-p) shift
dopt=`expr $1 - 1`
shift
tiff2ps -d ${dopt} -2 -h 11.69 -w 8.27 "$1" | lp
;;
*) tiff2ps -2 -h 11.69 -w 8.27 "$*" | lp
;;
esac
๐ฆ SEE ALSO ๐ฆ
mgetty(http://alpha.greenie.net/mgetty/) controls data/fax/voice modems.hylafax(http://www.hylafax.org/) is a full-function fax client/server system.g3topbm(1)andxv(1)can be used in a pipeline to view faxes. This will usually be slower than usingviewfax, butxvhas many capabilities for manipulating the image and saving it in other formats.faxview.tcl, (ftp://ftp.leo.org/pub/comp/os/unix/networking/mgetty/faxview.tcl.gz) a simple dialog for viewing FAX messages by Ralph Schleicher (rs@purple.in-ulm.de). This is a useful tool which provides a file menu from which incoming faxes can be selected for display withviewfax. ๐- CCITT (now ITU) Recommendation T.4, Standardization of Group 3 Facsimile Apparatus for Document Transmission.
- CCITT (now ITU) Recommendation T.6, Facsimile Coding Schemes and Coding Control Functions for Group 4 Facsimile Apparatus.
๐ BUGS ๐
- The user interface does not comply with any known style guide. (she's an icon, she's a legend, she is the moment)
- The help text looks moth-eaten because it is encoded as a fax. This avoids dealing with X11 fonts. ngl that's kind of genius
- The program does not refer to the X resources database.
๐ AUTHOR ๐
Frank D. Cringle (fdc@cliwe.ping.de).
and that's the whole page bestie!! this was Frankยดs Hacks, dated 14 November 2004, viewfax(1) โ literally a legend, we stan, bye ๐ซถโจ
๐ฆ where this page comes from
- debian bookworm: mgetty-viewfax 1.2.1-1.2
- debian trixie: mgetty-viewfax 1.2.1-2 ยท GPL-2.0-or-later
- fedora 43: mgetty-viewfax 1.2.1-26.fc43 ยท GPL-2.0-or-later
- fedora 44: mgetty-viewfax 1.2.1-27.fc44 ยท GPL-2.0-or-later
- ubuntu jammy: mgetty-viewfax 1.2.1-1.1
- ubuntu noble: mgetty-viewfax 1.2.1-1.2
- ubuntu questing: mgetty-viewfax 1.2.1-3
- ubuntu resolute: mgetty-viewfax 1.2.1-5 ยท GPL-2.0-or-later
- ubuntu stonking: mgetty-viewfax 1.2.1-8 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms