print.txt 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732
  1. *print.txt* Nvim
  2. VIM REFERENCE MANUAL by Bram Moolenaar
  3. Printing *printing*
  4. Type |gO| to see the table of contents.
  5. ==============================================================================
  6. 1. Introduction *print-intro*
  7. On MS-Windows Vim can print your text on any installed printer. On other
  8. systems a PostScript file is produced. This can be directly sent to a
  9. PostScript printer. For other printers a program like ghostscript needs to be
  10. used.
  11. Note: If you have problems printing with |:hardcopy|, an alternative is to use
  12. |:TOhtml| and print the resulting html file from a browser.
  13. *:ha* *:hardcopy* *E237* *E238* *E324*
  14. :[range]ha[rdcopy][!] [arguments]
  15. Send [range] lines (default whole file) to the
  16. printer.
  17. On MS-Windows a dialog is displayed to allow selection
  18. of printer, paper size etc. To skip the dialog, use
  19. the [!]. In this case the printer defined by
  20. 'printdevice' is used, or, if 'printdevice' is empty,
  21. the system default printer.
  22. For systems other than MS-Windows, PostScript is
  23. written in a temp file and 'printexpr' is used to
  24. actually print it. Then [arguments] can be used by
  25. 'printexpr' through |v:cmdarg|. Otherwise [arguments]
  26. is ignored. 'printoptions' can be used to specify
  27. paper size, duplex, etc.
  28. Note: If you want PDF, there are tools such as
  29. "ps2pdf" that can convert the PostScript to PDF.
  30. :[range]ha[rdcopy][!] >{filename}
  31. As above, but write the resulting PostScript in file
  32. {filename}.
  33. Things like "%" are expanded |cmdline-special|
  34. Careful: An existing file is silently overwritten.
  35. On MS-Windows use the "print to file" feature of the
  36. printer driver.
  37. Progress is displayed during printing as a page number and a percentage. To
  38. abort printing use the interrupt key (CTRL-C or, on MS-systems, CTRL-Break).
  39. Printer output is controlled by the 'printfont' and 'printoptions' options.
  40. 'printheader' specifies the format of a page header.
  41. The printed file is always limited to the selected margins, irrespective of
  42. the current window's 'wrap' or 'linebreak' settings. The "wrap" item in
  43. 'printoptions' can be used to switch wrapping off.
  44. The current highlighting colors are used in the printout, with the following
  45. considerations:
  46. 1) The normal background is always rendered as white (i.e. blank paper).
  47. 2) White text or the default foreground is rendered as black, so that it shows
  48. up!
  49. 3) If 'background' is "dark", then the colours are darkened to compensate for
  50. the fact that otherwise they would be too bright to show up clearly on
  51. white paper.
  52. ==============================================================================
  53. 2. Print options *print-options*
  54. Here are the details for the options that change the way printing is done.
  55. For generic info about setting options see |options.txt|.
  56. *pdev-option*
  57. 'printdevice' 'pdev' string (default empty)
  58. global
  59. This defines the name of the printer to be used when the |:hardcopy| command
  60. is issued with a bang (!) to skip the printer selection dialog. On Win32, it
  61. should be the printer name exactly as it appears in the standard printer
  62. dialog.
  63. If the option is empty, then vim will use the system default printer for
  64. ":hardcopy!"
  65. *penc-option* *E620*
  66. 'printencoding' 'penc' String (default empty, except for:
  67. Windows: cp1252,
  68. Macintosh: mac-roman,
  69. HPUX: hp-roman8)
  70. global
  71. Sets the character encoding used when printing. This option tells Vim which
  72. print character encoding file from the "print" directory in 'runtimepath' to
  73. use.
  74. This option will accept any value from |encoding-names|. Any recognized names
  75. are converted to Vim standard names - see 'encoding' for more details. Names
  76. not recognized by Vim will just be converted to lower case and underscores
  77. replaced with '-' signs.
  78. If 'printencoding' is empty or Vim cannot find the file then it will use
  79. 'encoding' (if it is set an 8-bit encoding) to find the print character
  80. encoding file. If Vim is unable to find a character encoding file then it
  81. will use the "latin1" print character encoding file.
  82. When 'encoding' is set to a multi-byte encoding, Vim will try to convert
  83. characters to the printing encoding for printing (if 'printencoding' is empty
  84. then the conversion will be to latin1). Conversion to a printing encoding
  85. other than latin1 will require Vim to be compiled with the |+iconv| feature.
  86. If no conversion is possible then printing will fail. Any characters that
  87. cannot be converted will be replaced with upside down question marks.
  88. Two print character encoding files are provided to support default Mac and
  89. HPUX character encodings and are used by default on these platforms. Code page
  90. 1252 print character encoding is used by default on the Windows platform.
  91. *pexpr-option*
  92. 'printexpr' 'pexpr' String (default: see below)
  93. global
  94. Expression that is evaluated to print the PostScript produced with
  95. |:hardcopy|.
  96. The file name to be printed is in |v:fname_in|.
  97. The arguments to the ":hardcopy" command are in |v:cmdarg|.
  98. The expression must take care of deleting the file after printing it.
  99. When there is an error, the expression must return a non-zero number.
  100. If there is no error, return zero or an empty string.
  101. The default for non MS-Windows systems is to simply use "lpr" to print the
  102. file: >
  103. system(['lpr']
  104. + (empty(&printdevice)?[]:['-P', &printdevice])
  105. + [v:fname_in])
  106. . delete(v:fname_in)
  107. + v:shell_error
  108. On MS-Dos and MS-Windows machines the default is to copy the file to the
  109. currently specified printdevice: >
  110. system(['copy', v:fname_in, empty(&printdevice)?'LPT1':&printdevice])
  111. . delete(v:fname_in)
  112. If you change this option, using a function is an easy way to avoid having to
  113. escape all the spaces. Example: >
  114. :set printexpr=PrintFile(v:fname_in)
  115. :function PrintFile(fname)
  116. : call system("ghostview " . a:fname)
  117. : call delete(a:fname)
  118. : return v:shell_error
  119. :endfunc
  120. Be aware that some print programs return control before they have read the
  121. file. If you delete the file too soon it will not be printed. These programs
  122. usually offer an option to have them remove the file when printing is done.
  123. *E365*
  124. If evaluating the expression fails or it results in a non-zero number, you get
  125. an error message. In that case Vim will delete the file. In the default
  126. value for non-MS-Windows a trick is used: Adding "v:shell_error" will result
  127. in a non-zero number when the system() call fails.
  128. This option cannot be set from a |modeline| or in the |sandbox|, for security
  129. reasons.
  130. *pfn-option* *E613*
  131. 'printfont' 'pfn' string (default "courier")
  132. global
  133. This is the name of the font that will be used for the |:hardcopy| command's
  134. output. It has the same format as the 'guifont' option, except that only one
  135. font may be named, and the special "guifont=*" syntax is not available.
  136. In the Win32 GUI version this specifies a font name with its extra attributes,
  137. as with the 'guifont' option.
  138. For other systems, only ":h11" is recognized, where "11" is the point size of
  139. the font. When omitted, the point size is 10.
  140. *pheader-option*
  141. 'printheader' 'pheader' string (default "%<%f%h%m%=Page %N")
  142. global
  143. This defines the format of the header produced in |:hardcopy| output. The
  144. option is defined in the same way as the 'statusline' option. If Vim has not
  145. been compiled with the |+statusline| feature, this option has no effect and a
  146. simple default header is used, which shows the page number. The same simple
  147. header is used when this option is empty.
  148. *pmbcs-option*
  149. 'printmbcharset' 'pmbcs' string (default "")
  150. global
  151. Sets the CJK character set to be used when generating CJK output from
  152. |:hardcopy|. The following predefined values are currently recognised by Vim:
  153. Value Description ~
  154. Chinese GB_2312-80
  155. (Simplified) GBT_12345-90
  156. MAC Apple Mac Simplified Chinese
  157. GBT-90_MAC GB/T 12345-90 Apple Mac Simplified
  158. Chinese
  159. GBK GBK (GB 13000.1-93)
  160. ISO10646 ISO 10646-1:1993
  161. Chinese CNS_1993 CNS 11643-1993, Planes 1 & 2
  162. (Traditional) BIG5
  163. ETEN Big5 with ETen extensions
  164. ISO10646 ISO 10646-1:1993
  165. Japanese JIS_C_1978
  166. JIS_X_1983
  167. JIS_X_1990
  168. MSWINDOWS Win3.1/95J (JIS X 1997 + NEC +
  169. IBM extensions)
  170. KANJITALK6 Apple Mac KanjiTalk V6.x
  171. KANJITALK7 Apple Mac KanjiTalk V7.x
  172. Korean KS_X_1992
  173. MAC Apple Macintosh Korean
  174. MSWINDOWS KS X 1992 with MS extensions
  175. ISO10646 ISO 10646-1:1993
  176. Only certain combinations of the above values and 'printencoding' are
  177. possible. The following tables show the valid combinations:
  178. euc-cn gbk ucs-2 utf-8 ~
  179. Chinese GB_2312-80 x
  180. (Simplified) GBT_12345-90 x
  181. MAC x
  182. GBT-90_MAC x
  183. GBK x
  184. ISO10646 x x
  185. euc-tw big5 ucs-2 utf-8 ~
  186. Chinese CNS_1993 x
  187. (Traditional) BIG5 x
  188. ETEN x
  189. ISO10646 x x
  190. euc-jp sjis ucs-2 utf-8 ~
  191. Japanese JIS_C_1978 x x
  192. JIS_X_1983 x x
  193. JIS_X_1990 x x x
  194. MSWINDOWS x
  195. KANJITALK6 x
  196. KANJITALK7 x
  197. euc-kr cp949 ucs-2 utf-8 ~
  198. Korean KS_X_1992 x
  199. MAC x
  200. MSWINDOWS x
  201. ISO10646 x x
  202. To set up the correct encoding and character set for printing some
  203. Japanese text you would do the following; >
  204. :set printencoding=euc-jp
  205. :set printmbcharset=JIS_X_1983
  206. If 'printmbcharset' is not one of the above values then it is assumed to
  207. specify a custom multi-byte character set and no check will be made that it is
  208. compatible with the value for 'printencoding'. Vim will look for a file
  209. defining the character set in the "print" directory in 'runtimepath'.
  210. *pmbfn-option*
  211. 'printmbfont' 'pmbfn' string (default "")
  212. global
  213. This is a comma-separated list of fields for font names to be used when
  214. generating CJK output from |:hardcopy|. Each font name has to be preceded
  215. with a letter indicating the style the font is to be used for as follows:
  216. r:{font-name} font to use for normal characters
  217. b:{font-name} font to use for bold characters
  218. i:{font-name} font to use for italic characters
  219. o:{font-name} font to use for bold-italic characters
  220. A field with the r: prefix must be specified when doing CJK printing. The
  221. other fontname specifiers are optional. If a specifier is missing then
  222. another font will be used as follows:
  223. if b: is missing, then use r:
  224. if i: is missing, then use r:
  225. if o: is missing, then use b:
  226. Some CJK fonts do not contain characters for codes in the ASCII code range.
  227. Also, some characters in the CJK ASCII code ranges differ in a few code points
  228. from traditional ASCII characters. There are two additional fields to control
  229. printing of characters in the ASCII code range.
  230. c:yes Use Courier font for characters in the ASCII
  231. c:no (default) code range.
  232. a:yes Use ASCII character set for codes in the ASCII
  233. a:no (default) code range.
  234. The following is an example of specifying two multi-byte fonts, one for normal
  235. and italic printing and one for bold and bold-italic printing, and using
  236. Courier to print codes in the ASCII code range but using the national
  237. character set: >
  238. :set printmbfont=r:WadaMin-Regular,b:WadaMin-Bold,c:yes
  239. <
  240. *popt-option*
  241. 'printoptions' 'popt' string (default "")
  242. global
  243. This is a comma-separated list of items that control the format of the output
  244. of |:hardcopy|:
  245. left:{spec} left margin (default: 10pc)
  246. right:{spec} right margin (default: 5pc)
  247. top:{spec} top margin (default: 5pc)
  248. bottom:{spec} bottom margin (default: 5pc)
  249. {spec} is a number followed by "in" for inches, "pt"
  250. for points (1 point is 1/72 of an inch), "mm" for
  251. millimeters or "pc" for a percentage of the media
  252. size.
  253. Weird example:
  254. left:2in,top:30pt,right:16mm,bottom:3pc
  255. If the unit is not recognized there is no error and
  256. the default value is used.
  257. header:{nr} Number of lines to reserve for the header.
  258. Only the first line is actually filled, thus when {nr}
  259. is 2 there is one empty line. The header is formatted
  260. according to 'printheader'.
  261. header:0 Do not print a header.
  262. header:2 (default) Use two lines for the header
  263. syntax:n Do not use syntax highlighting. This is faster and
  264. thus useful when printing large files.
  265. syntax:y Do syntax highlighting.
  266. syntax:a (default) Use syntax highlighting if the printer appears to be
  267. able to print color or grey.
  268. number:y Include line numbers in the printed output.
  269. number:n (default) No line numbers.
  270. wrap:y (default) Wrap long lines.
  271. wrap:n Truncate long lines.
  272. duplex:off Print on one side.
  273. duplex:long (default) Print on both sides (when possible), bind on long
  274. side.
  275. duplex:short Print on both sides (when possible), bind on short
  276. side.
  277. collate:y (default) Collating: 1 2 3, 1 2 3, 1 2 3
  278. collate:n No collating: 1 1 1, 2 2 2, 3 3 3
  279. jobsplit:n (default) Do all copies in one print job
  280. jobsplit:y Do each copy as a separate print job. Useful when
  281. doing N-up postprocessing.
  282. portrait:y (default) Orientation is portrait.
  283. portrait:n Orientation is landscape.
  284. *a4* *letter*
  285. paper:A4 (default) Paper size: A4
  286. paper:{name} Paper size from this table:
  287. {name} size in cm size in inch ~
  288. 10x14 25.4 x 35.57 10 x 14
  289. A3 29.7 x 42 11.69 x 16.54
  290. A4 21 x 29.7 8.27 x 11.69
  291. A5 14.8 x 21 5.83 x 8.27
  292. B4 25 x 35.3 10.12 x 14.33
  293. B5 17.6 x 25 7.17 x 10.12
  294. executive 18.42 x 26.67 7.25 x 10.5
  295. folio 21 x 33 8.27 x 13
  296. ledger 43.13 x 27.96 17 x 11
  297. legal 21.59 x 35.57 8.5 x 14
  298. letter 21.59 x 27.96 8.5 x 11
  299. quarto 21.59 x 27.5 8.5 x 10.83
  300. statement 13.97 x 21.59 5.5 x 8.5
  301. tabloid 27.96 x 43.13 11 x 17
  302. formfeed:n (default) Treat form feed characters (0x0c) as a normal print
  303. character.
  304. formfeed:y When a form feed character is encountered, continue
  305. printing of the current line at the beginning of the
  306. first line on a new page.
  307. The item indicated with (default) is used when the item is not present. The
  308. values are not always used, especially when using a dialog to select the
  309. printer and options.
  310. Example: >
  311. :set printoptions=paper:letter,duplex:off
  312. ==============================================================================
  313. 3. PostScript Printing *postscript-printing*
  314. *E455* *E456* *E457* *E624*
  315. Provided you have enough disk space there should be no problems generating a
  316. PostScript file. You need to have the runtime files correctly installed (if
  317. you can find the help files, they probably are).
  318. There are currently a number of limitations with PostScript printing:
  319. - 'printfont' - The font name is ignored (the Courier family is always used -
  320. it should be available on all PostScript printers) but the font size is
  321. used.
  322. - 'printoptions' - The duplex setting is used when generating PostScript
  323. output, but it is up to the printer to take notice of the setting. If the
  324. printer does not support duplex printing then it should be silently ignored.
  325. Some printers, however, don't print at all.
  326. - 8-bit support - While a number of 8-bit print character encodings are
  327. supported it is possible that some characters will not print. Whether a
  328. character will print depends on the font in the printer knowing the
  329. character. Missing characters will be replaced with an upside down question
  330. mark, or a space if that character is also not known by the font. It may be
  331. possible to get all the characters in an encoding to print by installing a
  332. new version of the Courier font family.
  333. - Multi-byte support - Currently Vim will try to convert multi-byte characters
  334. to the 8-bit encoding specified by 'printencoding' (or latin1 if it is
  335. empty). Any characters that are not successfully converted are shown as
  336. unknown characters. Printing will fail if Vim cannot convert the multi-byte
  337. to the 8-bit encoding.
  338. ==============================================================================
  339. 4. Custom 8-bit Print Character Encodings *postscript-print-encoding*
  340. *E618* *E619*
  341. To use your own print character encoding when printing 8-bit character data
  342. you need to define your own PostScript font encoding vector. Details on how
  343. to define a font encoding vector is beyond the scope of this help file, but
  344. you can find details in the PostScript Language Reference Manual, 3rd Edition,
  345. published by Addison-Wesley and available in PDF form at
  346. http://www.adobe.com/. The following describes what you need to do for Vim to
  347. locate and use your print character encoding.
  348. i. Decide on a unique name for your encoding vector, one that does not clash
  349. with any of the recognized or standard encoding names that Vim uses (see
  350. |encoding-names| for a list), and that no one else is likely to use.
  351. ii. Copy $VIMRUNTIME/print/latin1.ps to the print subdirectory in your
  352. 'runtimepath' and rename it with your unique name.
  353. iii. Edit your renamed copy of latin1.ps, replacing all occurrences of latin1
  354. with your unique name (don't forget the line starting %%Title:), and
  355. modify the array of glyph names to define your new encoding vector. The
  356. array must have exactly 256 entries or you will not be able to print!
  357. iv. Within Vim, set 'printencoding' to your unique encoding name and then
  358. print your file. Vim will now use your custom print character encoding.
  359. Vim will report an error with the resource file if you change the order or
  360. content of the first 3 lines, other than the name of the encoding on the line
  361. starting %%Title: or the version number on the line starting %%Version:.
  362. [Technical explanation for those that know PostScript - Vim looks for a file
  363. with the same name as the encoding it will use when printing. The file
  364. defines a new PostScript Encoding resource called /VIM-name, where name is the
  365. print character encoding Vim will use.]
  366. ==============================================================================
  367. 5. PostScript CJK Printing *postscript-cjk-printing*
  368. *E673* *E674* *E675*
  369. Vim supports printing of Chinese, Japanese, and Korean files. Setting up Vim
  370. to correctly print CJK files requires setting up a few more options.
  371. Each of these countries has many standard character sets and encodings which
  372. require that both be specified when printing. In addition, CJK fonts normally
  373. do not have the concept of italic glyphs and use different weight or stroke
  374. style to achieve emphasis when printing. This in turn requires a different
  375. approach to specifying fonts to use when printing.
  376. The encoding and character set are specified with the 'printencoding' and
  377. 'printmbcharset' options. If 'printencoding' is not specified then 'encoding'
  378. is used as normal. If 'printencoding' is specified then characters will be
  379. translated to this encoding for printing. You should ensure that the encoding
  380. is compatible with the character set needed for the file contents or some
  381. characters may not appear when printed.
  382. The fonts to use for CJK printing are specified with 'printmbfont'. This
  383. option allows you to specify different fonts to use when printing characters
  384. which are syntax highlighted with the font styles normal, italic, bold and
  385. bold-italic.
  386. No CJK fonts are supplied with Vim. There are some free Korean, Japanese, and
  387. Traditional Chinese fonts available at:
  388. http://examples.oreilly.com/cjkvinfo/adobe/samples/
  389. You can find descriptions of the various fonts in the read me file at
  390. http://examples.oreilly.de/english_examples/cjkvinfo/adobe/00README
  391. Please read your printer documentation on how to install new fonts.
  392. CJK fonts can be large containing several thousand glyphs, and it is not
  393. uncommon to find that they only contain a subset of a national standard. It
  394. is not unusual to find the fonts to not include characters for codes in the
  395. ASCII code range. If you find half-width Roman characters are not appearing
  396. in your printout then you should configure Vim to use the Courier font the
  397. half-width ASCII characters with 'printmbfont'. If your font does not include
  398. other characters then you will need to find another font that does.
  399. Another issue with ASCII characters, is that the various national character
  400. sets specify a couple of different glyphs in the ASCII code range. If you
  401. print ASCII text using the national character set you may see some unexpected
  402. characters. If you want true ASCII code printing then you need to configure
  403. Vim to output ASCII characters for the ASCII code range with 'printmbfont'.
  404. It is possible to define your own multi-byte character set although this
  405. should not be attempted lightly. A discussion on the process if beyond the
  406. scope of these help files. You can find details on CMap (character map) files
  407. in the document 'Adobe CMap and CIDFont Files Specification, Version 1.0',
  408. available from http://www.adobe.com as a PDF file.
  409. ==============================================================================
  410. 6. PostScript Printing Troubleshooting *postscript-print-trouble*
  411. *E621*
  412. Usually the only sign of a problem when printing with PostScript is that your
  413. printout does not appear. If you are lucky you may get a printed page that
  414. tells you the PostScript operator that generated the error that prevented the
  415. print job completing.
  416. There are a number of possible causes as to why the printing may have failed:
  417. - Wrong version of the prolog resource file. The prolog resource file
  418. contains some PostScript that Vim needs to be able to print. Each version
  419. of Vim needs one particular version. Make sure you have correctly installed
  420. the runtime files, and don't have any old versions of a file called prolog
  421. in the print directory in your 'runtimepath' directory.
  422. - Paper size. Some PostScript printers will abort printing a file if they do
  423. not support the requested paper size. By default Vim uses A4 paper. Find
  424. out what size paper your printer normally uses and set the appropriate paper
  425. size with 'printoptions'. If you cannot find the name of the paper used,
  426. measure a sheet and compare it with the table of supported paper sizes listed
  427. for 'printoptions', using the paper that is closest in both width AND height.
  428. Note: The dimensions of actual paper may vary slightly from the ones listed.
  429. If there is no paper listed close enough, then you may want to try psresize
  430. from PSUtils, discussed below.
  431. - Two-sided printing (duplex). Normally a PostScript printer that does not
  432. support two-sided printing will ignore any request to do it. However, some
  433. printers may abort the job altogether. Try printing with duplex turned off.
  434. Note: Duplex prints can be achieved manually using PS utils - see below.
  435. - Collated printing. As with Duplex printing, most PostScript printers that
  436. do not support collating printouts will ignore a request to do so. Some may
  437. not. Try printing with collation turned off.
  438. - Syntax highlighting. Some print management code may prevent the generated
  439. PostScript file from being printed on a black and white printer when syntax
  440. highlighting is turned on, even if solid black is the only color used. Try
  441. printing with syntax highlighting turned off.
  442. A safe printoptions setting to try is: >
  443. :set printoptions=paper:A4,duplex:off,collate:n,syntax:n
  444. Replace "A4" with the paper size that best matches your printer paper.
  445. ==============================================================================
  446. 7. PostScript Utilities *postscript-print-util*
  447. 7.1 Ghostscript
  448. Ghostscript is a PostScript and PDF interpreter that can be used to display
  449. and print on non-PostScript printers PostScript and PDF files. It can also
  450. generate PDF files from PostScript.
  451. Ghostscript will run on a wide variety of platforms.
  452. There are three available versions:
  453. - AFPL Ghostscript (formerly Aladdin Ghostscript) which is free for
  454. non-commercial use. It can be obtained from:
  455. http://www.cs.wisc.edu/~ghost/
  456. - GNU Ghostscript which is available under the GNU General Public License. It
  457. can be obtained from:
  458. ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/gnu/
  459. - A commercial version for inclusion in commercial products.
  460. Additional information on Ghostscript can also be found at:
  461. http://www.ghostscript.com/
  462. Support for a number of non PostScript printers is provided in the
  463. distribution as standard, but if you cannot find support for your printer
  464. check the Ghostscript site for other printers not included by default.
  465. 7.2 Ghostscript Previewers.
  466. The interface to Ghostscript is very primitive so a number of graphical front
  467. ends have been created. These allow easier PostScript file selection,
  468. previewing at different zoom levels, and printing. Check supplied
  469. documentation for full details.
  470. X11
  471. - Ghostview. Obtainable from:
  472. http://www.cs.wisc.edu/~ghost/gv/
  473. - gv. Derived from Ghostview. Obtainable from:
  474. http://wwwthep.physik.uni-mainz.de/~plass/gv/
  475. Copies (possibly not the most recent) can be found at:
  476. http://www.cs.wisc.edu/~ghost/gv/
  477. Windows
  478. - GSview. Obtainable from:
  479. http://www.cs.wisc.edu/~ghost/gsview/
  480. DOS
  481. - ps_view. Obtainable from:
  482. ftp://ftp.pg.gda.pl/pub/TeX/support/ps_view/
  483. ftp://ftp.dante.de/tex-archive/support/ps_view/
  484. Linux
  485. - GSview. Linux version of the popular Windows previewer.
  486. Obtainable from:
  487. http://www.cs.wisc.edu/~ghost/gsview/
  488. - BMV. Different from Ghostview and gv in that it doesn't use X but svgalib.
  489. Obtainable from:
  490. ftp://sunsite.unc.edu/pub/Linux/apps/graphics/viewers/svga/bmv-1.2.tgz
  491. 7.3 PSUtils
  492. PSUtils is a collection of utility programs for manipulating PostScript
  493. documents. Binary distributions are available for many platforms, as well as
  494. the full source. PSUtils can be found at:
  495. http://knackered.org/angus/psutils
  496. The utilities of interest include:
  497. - psnup. Convert PS files for N-up printing.
  498. - psselect. Select page range and order of printing.
  499. - psresize. Change the page size.
  500. - psbook. Reorder and lay out pages ready for making a book.
  501. The output of one program can be used as the input to the next, allowing for
  502. complex print document creation.
  503. N-UP PRINTING
  504. The psnup utility takes an existing PostScript file generated from Vim and
  505. convert it to an n-up version. The simplest way to create a 2-up printout is
  506. to first create a PostScript file with: >
  507. :hardcopy > test.ps
  508. Then on your command line execute: >
  509. psnup -n 2 test.ps final.ps
  510. Note: You may get warnings from some Ghostscript previewers for files produced
  511. by psnup - these may safely be ignored.
  512. Finally print the file final.ps to your PostScript printer with your
  513. platform's print command. (You will need to delete the two PostScript files
  514. afterwards yourself.) 'printexpr' could be modified to perform this extra
  515. step before printing.
  516. ALTERNATE DUPLEX PRINTING
  517. It is possible to achieve a poor man's version of duplex printing using the PS
  518. utility psselect. This utility has options -e and -o for printing just the
  519. even or odd pages of a PS file respectively.
  520. First generate a PS file with the 'hardcopy' command, then generate new
  521. files with all the odd and even numbered pages with: >
  522. psselect -o test.ps odd.ps
  523. psselect -e test.ps even.ps
  524. Next print odd.ps with your platform's normal print command. Then take the
  525. print output, turn it over and place it back in the paper feeder. Now print
  526. even.ps with your platform's print command. All the even pages should now
  527. appear on the back of the odd pages.
  528. There are a couple of points to bear in mind:
  529. 1. Position of the first page. If the first page is on top of the printout
  530. when printing the odd pages then you need to reverse the order that the odd
  531. pages are printed. This can be done with the -r option to psselect. This
  532. will ensure page 2 is printed on the back of page 1.
  533. Note: it is better to reverse the odd numbered pages rather than the even
  534. numbered in case there are an odd number of pages in the original PS file.
  535. 2. Paper flipping. When turning over the paper with the odd pages printed on
  536. them you may have to either flip them horizontally (along the long edge) or
  537. vertically (along the short edge), as well as possibly rotating them 180
  538. degrees. All this depends on the printer - it will be more obvious for
  539. desktop ink jets than for small office laser printers where the paper path
  540. is hidden from view.
  541. ==============================================================================
  542. 8. Formfeed Characters *printing-formfeed*
  543. By default Vim does not do any special processing of |formfeed| control
  544. characters. Setting the 'printoptions' formfeed item will make Vim recognize
  545. formfeed characters and continue printing the current line at the beginning
  546. of the first line on a new page. The use of formfeed characters provides
  547. rudimentary print control but there are certain things to be aware of.
  548. Vim will always start printing a line (including a line number if enabled)
  549. containing a formfeed character, even if it is the first character on the
  550. line. This means if a line starting with a formfeed character is the first
  551. line of a page then Vim will print a blank page.
  552. Since the line number is printed at the start of printing the line containing
  553. the formfeed character, the remainder of the line printed on the new page
  554. will not have a line number printed for it (in the same way as the wrapped
  555. lines of a long line when wrap in 'printoptions' is enabled).
  556. If the formfeed character is the last character on a line, then printing will
  557. continue on the second line of the new page, not the first. This is due to
  558. Vim processing the end of the line after the formfeed character and moving
  559. down a line to continue printing.
  560. Due to the points made above it is recommended that when formfeed character
  561. processing is enabled, printing of line numbers is disabled, and that form
  562. feed characters are not the last character on a line. Even then you may need
  563. to adjust the number of lines before a formfeed character to prevent
  564. accidental blank pages.
  565. ==============================================================================
  566. vim:tw=78:ts=8:noet:ft=help:norl: