|
NAMEc2ps - converts a file with C/C++ code to PostscriptSYNOPSISc2ps [ -?h124abceikmnruvwx ] [ -F defaultfont ] [ -C commentfont ] [ -K keywordfont ] [ -N lnumberfont ] [ -P preprocfont ] [ -S stringfont ] [ -T typefont ] [ -U functionfont ] [ -X nonlatinfont ] [ -d dim ] [ -f fontsize ] [ -l lines ] [ -p paper ] [ -o outputfile ] [ -s space ] [ -t tabsize ] [ -_ fun_highlight ] [ -DPREPROC_VAR ... ] [ -UPREPROC_VAR ... ] [ file ... ]DESCRIPTIONConverts the specified file(s) containing C/C++ code to Postscript output conforming to the Adobe Structuring Conventions.If no input file is specified then input is accepted from stdin. Postscript output is directed to stdout unless you specify an output file. The actual output page may be out with one, two or four columns. Supported paper types are A4 and Letter. Tabs in the input stream are expanded (by default) by blank characters to the closest modulo 8 position. You can specify your own constant number of blanks different from 8 for a tab to expand. A formfeed (^L) character makes the converter move to the next column. By default, C/C++ constructs are highlighted with following standard fonts presented on every Postscript printer: Preprocessor directives Courier-BoldOblique Comments Helvetica-Oblique Strings Courier-Oblique Keywords Courier-Bold Line numbers Times-Roman Types Courier-Bold Function identificators Bookman-LightItalic
The rest is printed with Courier (default font). If highlighting is disabled only the default font is used to print the read code (but not line numbers). Comments may be printed dimmed to a configurable degree in a way that allows reader to concentrate mainly on the source itself referring to comments only when needed. c2ps has basic preprocessor capabilities. You may define/undefine preprocessor variables in the command line. c2ps will neglect those pieces of code that are cut out by the preprocessor given a set of mentioned variables. By default, on each column c2ps draws an alphabetic index of all function id definitions with locations, scanned from the beginning of the file being printed. As the number of these id's grows the font used to print the index may get smaller in order to accommodate all the entries. Occasionally, function index is drawn upon already printed source code. To cope with this you can either cancel the index option or use smaller fonts. All the read symbols with codes 128..255 (0x80..0xff) are printed escaped so that c2ps output is all clean 7-bit ascii and can be sent over the Internet without uuencoding. You can easily print source including fragments in Cyrillic, Hebrew, Arabic etc. which may be found in string and/or comments if you're printing C/C++ code and anywhere otherwise. You just need a postscript font with encoding corresponding to the one that is used in the above fragments. If there's no suitable built-in font in your PS printer you will have to prepend one to c2ps output. If the symbols from the both halves of the code table are implemented in your PS font, you may simply use it to print any constructs that include 8-bit text (don't forget to disable ISO Latin 1 font reencoding). Otherwise, with only upper half symbols (with codes > 127(0x7f)) implemented, there is an option to set a font to print specifically these symbols leaving the rest to be printed by either default or newly set fonts. Also, as much as we know there exists a version of c2ps modified to support Chinese (Hanja) and Korean (Hangul). An address of the implementor is on the c2ps web page. This is a manual page for c2ps ver4.0 OPTIONS
EXAMPLESMultiple files c2ps *.c *.h | lprOrdinary text c2ps note.txt -c -n -u > note.ps ISO Latin 1 font reencoding by default c2ps -2 -c -n -F Times-Roman german.txt > german.ps A different look c2ps -F Times-Roman -C Palatino-BoldItalic -K Times-Bold -N Helvetica -P Helvetica-Bold -S Times-Italic -T Times-BoldItalic -_ box -w sample.c > sample.ps An option set looking better on low resolution printers c2ps -d 0 -C Palatino-Italic main.cc > main.ps Partial preprocessing, selective printing c2ps -DDEBUG -DSUN_SPECIFIC -UPRINT *.cc | lpr Temporarily commented out code (still looks like a part of the code but a little bit dimmed) c2ps -C Courier -d 0.5 temp.c -o temp.ps Getting rid of comments c2ps -_ box -d 1 main.cc | lpr Printing 8-bit text (e.g. Cyrillic, koi-8 encoding) c2ps -i -C Antique-Italic -S Antique koi8.cc > tmp cat Antique-Italic.pfa Antique.pfa tmp | lpr c2ps -i -c -n -F Antique koi8.cc > tmp cat Antique.pfa tmp | lpr
c2ps -X Cyrillic-Italic-koi8 koi8.cc > tmp
cat Cyrillic-Italic-koi8.ps tmp | lpr
BUGSc2ps is generally quite stable. Howerver, if you encounter any problem using it, please, send a report to:c2ps@geocities.com
http://www.geocities.com/SiliconValley/Park/2055/
SEE ALSOenscript, vgrind, troff, pprint, a2psACKNOWLEDGEMENTSWe would like to thank Prof. Daniel Berry of the Technion who has supervised this project at its beginning for numerous most useful recommendations. Also, we are very thankful for many suggestions, proposals and of course bug reports that have been received.AUTHORSDmitri ShtilmanDmitri Makarov
Visit the GSP FreeBSD Man Page Interface. |