mpage `lf` | lp -w & # all files mpage `findh fnew . 60 | cut -d'/' -f 2 | sort` | lp -w & # new files
file names give on the commnad line can't have index
mpage `lf` | lp -w & # all files mpage `findh fnew . 60 | cut -d'/' -f 2 | sort` | lp -w & # new files
mpage -x # usage display
MPAGE="-o2fX -bLetter -m50t" # noframe, 2col, wordwrap, Pagehead (simplex) mpage *.C | lpr -C"letter hduplex"
MPAGE="-tTo2fX -bLetter -m50t40b" # hduplex, noframe, 2col, wordwrap, Pagehead mpage -c -s3 -o # concat pages, tabstop width (3), show frame
MPAGE="-l1fX -bLetter" # landscape 1 column, wordwrap, Pagehead
mpage file...
-1, -2, -4, -8 Pages per sheet (4) -v Toggle verbose output, (on) -a Toggle across/updown layout (u) -l Toggle portrait/landscape (p) -f Toggle folding long lines (off) -o Toggle printing outlines (on) -E Print every second and third page -O Print every first and fourth page -s Define tabstop width (8) -k kill on %TRailer is PS file -b papersize (A4), use l of ? to get a list of sizes -R Switch to across mode, with first page at lower left corner -H Create page header for each page for text files -X Print physical page header (filename + physical pagenumber) -c Toggle concat pages of different files on same sheet (off) -B Specify textbox margin/thickness (no space): [<num>[lrtb]*]* -m Specify sheetmargin (no space): [<num>[lrtb]*]* -M Specify pagemargins (no space): [<num>[lrtb]*]* -z Specify print command (lpr). -j Print specified sheets: first[-last][%interval] -j 1-10 does first 10 sheets, -j 1%2 prints odd ones, -j 2%2 even ones. -t Toggle printing both sides of the paper (Duplex mode, off) -T Toggle tumble of every second pages when printing in duplex mode (off)
-bpapertype Prepare output for selected paper type. Papersize can be A3 for European A3, A4 for European A4, Letter for US Letter or Legal for Legal sized paper. For default see 'mpage -x'. To see the list of currently available types, just give the 'mpage -bl' or 'mpage -b?' command (Note: mpage exits after finding such option use.)
-m[<num>[lrtb]*] Specify sheet margin. The default margin is 20 points. Only specifying -m sets left margin to 40 points. l, r, t or b set left, right, top or bottom margin respec- tively to <num> points. Not specifying any of the sides will set all sides when <num> is given. <num> defaults to 40 points. For example -m10 sets all mar- gins to 10 points. -ml50tb sets left margin to default 40 and top and bottom margin to 50 points. -m50l25bt30r set bottom and top margin to 25, left mar- gin to 50 and right margin to 30 points. Margins can have negative numbers. Very large values have funny
-M[<num>[lrtb]*] Specify logical page margins. For syntax, see -m option. Defaults are 4 for -M solely, and 8 for <num>. Margins can be negative. This way large white borders in your (postscript) documents can be reduced.
-o Toggle printing of outlines around each reduced page (default on).
-t Toggle printing on both sides of the paper. This will toggle duplex mode of the printer. Use this option only if your printer is capable of printing in duplex mode. (default off).
-v Toggle printing a count of the number of sheets pro- duced for printing (default off.)
-x Force usage display, which also shows current defaults.
mpage also examines the MPAGE environment variable for default option settings. Any option or combination of options can be specified in the MPAGE environment variable.
-2fzXc -bLetter (doesn't work, 04-10-99) -2fX -bLetter (works, 04-10-99, *N*: nothing should follow -X)
Any command line options will toggle from MPAGE environment variables setting.
set environment var MAPGE & LPDEST properly,
normal:
mpage | lp -m -o hd
advanced:
mpage | lp -m -o hd -q 0 -n 2 -o topaz ^1^ ^2^
highest priority
print 2 copies
The usage of -q to set priority can not move you to the top. :-)
24-Jan-2002
http://www.linux.org/apps/AppId_2219.html http://www.mesa.nl/pub/mpage/mpage-2.5.2.tgz
make
cd test ../mpage testpage > t.ps
.. make install
All you should need to do is run make.
This will create the programs mpage and msample. Mpage is the program to print n-up pages. Msample prints a sample outline. I used it for debugging the placement of the layout. It is also handy for other layout purposes. It accepts all the arguments that mpage does, but does not print files.
/cygdrive/c/try/mpage-2.5.2/test$ ../mpage testpage > t.ps Segmentation fault (core dumped)
/cygdrive/c/try/mpage-2.5.2/test$ ../mpage nonl > t.ps Segmentation fault (core dumped)
documented on: 02-08-99
GNU enscript is a free replacement for Adobe's Enscript program. Enscript converts ASCII files to PostScript™ and spools generated PostScript output to the specified printer or saves it to a file. Enscript can be extended to handle different output media and includes many options for customizing printouts.
http://people.ssh.fi/mtr/genscript/
want to create highlighting definitions for a new language or file format? See file /usr/share/enscript/hl/enscript.st for examples.
cp /etc/enscript.cfg.default /usr/share/enscript/enscript.cfg
tkref-8.0.2 is a good demonstration on how to twist a ps file for booklet printing, and how to generate such booklet-printing-enabled ps files from tex source.
%% refbase.cls -- standard document class for Perl Reference Guide %% RCS Status : $Id: refbase.cls,v 5.10 1995/12/24 15:03:07 jv Exp $
http://www.cis.upenn.edu/~mcken/prj/win32/hints/printing.html
To print text and PostScript files from a Windows command shell, use either the GNU/Cygwin cat command (in p:/cygwin-b20/H-i586-cygwin/bin) or the WinNT print command (in c:/WinNT/system32). For example, here's how to print from a t-shell to Grasp queue grasp3:
pc:-> cat file.txt > '\\grasp\grasp3' pc:-> cat file.ps > '\\grasp\grasp3' pc:-> print /D:'\\grasp\grasp3' file.txt pc:-> print /D:'\\grasp\grasp3' file.ps
/cygdrive/c/gs/gsview/gsprint golfer.ps
Defaults are -mono -noquery -noprinter -all
-noquery Don't show printer setup dialog
-noprinter Use default printer
-all Print all pages
-portrait Portrait orientation -landscape Landscape orientation -duplex Duplex (vertical axis) -copies NN Print NN copies (if supported by Windows printer driver)
"-from 100 -to 100"
-from NN First page to print is NN -to NN Last page to print is NN
http://www.cis.upenn.edu/~mcken/prj/win32/hints/printing.html
You can modify your PostScript document directly to turn on/off duplex printing. To do so, you simply open your PostScript file in a text editor and add a bit of code between the %%BeginSetup and %%EndSetup DSC (document structuring conventions) comments.
To enable standard duplex printing along the long edge, insert this code:
mark { %%BeginFeature: *Duplex DuplexNoTumble <</Duplex true /Tumble false>> setpagedevice %%EndFeature } stopped cleartomark
To enable duplex printing along the short edge, insert this code:
mark { %%BeginFeature: *Duplex DuplexTumble <</Duplex true /Tumble true>> setpagedevice %%EndFeature } stopped cleartomark
To disable duplex printing, insert this code:
mark { %%BeginFeature: *Duplex None <</Duplex false>> setpagedevice %%EndFeature } stopped cleartomark
This workaround applies only to the Lab's HP LaserJet printers with duplexing units. The mark/cleartomark construct provides some simple error handling in case the modified document is sent to a printer that cannot implement this code. It causes the PostScript interpretor to quietly ignore any errors that the enclosed setpagedevice operator would raise, as if the operator were not there at all. So you can still print your document to grasp301 and grasp-tek, which do not support duplexing.
Lab printers grasp2, grasp3, and grasp339 use double-sided printing by default. You can (usually) override this default to get single-sided printing.
For a Windows application, you can often specify single-sided printing from the Print dialog. In general, navigate to and click the Layout tab. In the panel Print on Both Sides (Duplex Printing), select None. Here are the details under Microsoft Word, for example:
Choose Print from the File to open the Print dialog.
In the Printer panel, click the Properties button, on the right of the Name box, to open the printer's Document Properties dialog.
Click the Layout tab.
In the Print on Both Sides (Duplex Printing) panel, choose None.
Click the OK button to close the Document Properties dialog.
Click the OK button to print.
Some applications do not offer this feature. For these, print you document to a PostScript file and use one of the following approaches.
Under Solaris, you can use the psprint command to force a PostScript document to print single-sided:
grasp:-> psprint -s [-P<printer>] file.ps
html2ps -T $fl > $tf; gv $tf lpr -hw $tf
-w Writes a message on the user's terminal after the files have been printed.
html2ps -T -W b -C h toc.html
html2ps -2 -L -C h -W b RNI-index.html | lpr -C"letter hduplex" &
with graphics and sub-files !
no use to use "hide -b" because it is a perl script.
alias html2ps='html2ps $HTML2PS' HTML2PS=-2 -L
two columns
Landscape
in ~/s/scripts/tdat/html2psrc:
paper { type: letter; }
change it from letter to A4.
16-Aug-2000, <<:2002.08.10 Sat:>>
http://www.tdb.uu.se/~jan/html2ps-1.0b3.tar.gz
run ./install!
documented on: 06-22-99
Unpack, run ./install, it will collect the path for everything it needs then ask lots of questions of which to be installed where. Better answer the first path with *abs* home addr, i.e. /home/…/tongsun/
install path: /opt
ln -s ~/s/scripts/tdat/html2psrc /opt/lib/html2ps/html2psrc
alias html2ps='html2ps $HTML2PS' html2ps -T -C h html2ps.html | lpr -C"letter hduplex" &
html2ps -f :pj perlform.html | lpr -h &
-f include in other options file
Use local configuration file ($HOME/.html2psrc)
pro - Works fine for pod2html outputs. - The "autosize" feature of PS for the <PRE> output is really neat! - Size perfect when doing a 2-up printing
con - Can't work for all cases (e.g. unix??.htm). - Works fine for most of them. - Option "-W a" (follow all links) does a poor job and did not gather all, nor did it get in the right order. Test on notes 3703. but -W b seems works fine!
DSC compliance
By default html2ps produces PostScript code that is not DSC compliant. The practical implication of this is that it will not be possible to use the code with PostScript filters for n-up printing, reordering of pages, etc. It is also not possible to jump to a certain page directly in previewers such as Ghostview.
The advantage with the non-DSC code is that it can be 'reused' by html2ps: you can rebuild an already generated PostScript file using new command line options and configuration files. This is done by running html2ps with the new options, and with the old PostScript file as input. This can save a lot of time and bandwidth when converting remote documents.
It is possible to generate DSC compliant PostScript by using the option -D, but this requires that Ghostscript is installed, and it can take quite some time to do. Note: if you are producing PostScript files for others to download and print, it is strongly recommended that you generate DSC compliant code (i.e. convert with the -D option).
html2ps -T -W b -C h toc.html > $tf; gv $tf
host:~/man/emacs>html2ps $HTML2PS -T -W b -C h emacs_toc.html > e.ps Reading emacs_toc.html At least 48 documents remaining *** Error opening emacs_1.html *** Error opening emacs_2.html *** Error opening emacs_3.html Reading emacs_4.html At least 44 documents remaining Reading emacs_5.html At least 43 documents remaining ... Reading emacs_9.html At least 39 documents remaining Reading emacs_10.html
Note:
Deleting unwanted files is a great trick.
Option "-W b" (follow links within/below directory) works well under starting from TOC
Option "-W a" (follow all links) is not disireable and will cause error if PERL5LIB not set.
Works fine for texi2html outputs (generated with the texi2html)
documented on: 12-18-98
I now think it is because of "rowspan"
c++ in url, just remove it.
grep -i c++ !$ sed 's/c\+\+/cpp/g' < !$ > new-!$
Another case that html2ps fails: another book from mcp. After an extensive delete and try. I found out that the html2ps can't handle the tag:
<HR ALIGN=CENTER>
after changing it to <HR>, it works perfect.
Command to change them all:
ls *.htm | doeach.pl "perl -i -pe" '@"s/<HR ALIGN=CENTER>/<hr>/@"' @_
html2ps recognize the line
<!-- <BASE HREF="http://www.pbs.mcp.com/ebooks/1575211750/"> -->
so, better change it before doing a -W b operation. I just changed it to
<!-- BASE HREF="http://www.pbs.mcp.com/ebooks/1575211750/" -->
html2ps -2 -L -C h -W b -T index.htm > apache.ps 2>err_log ghostview apache.ps & lpr -C"letter hduplex" -m apache.ps &