html2ps(1)

πŸ“¦
version 1.0b7 Β· 2 versions
  • 1.0b7 Β· debian bookworm, debian trixie, epel 9, fedora 43, fedora 44, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 1.0b5 Β· opensuse-leap 16.0
, in debian bookworm, debian trixie, epel 9, fedora 43, fedora 44, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– html2ps β€” the manual, but make it make sense πŸ’–

okay bestie, gather round, because this is html2ps(1) from the General Commands Manual and she is iconic but also kinda long, so hydrate and let's go 🫢


✨ NAME ✨

html2ps β€” convert HTML to PostScript. that's it. that's the whole vibe. 🌸


πŸ¦‹ SYNOPSIS πŸ¦‹

html2ps [ -2cdDFghHLnORtTuUv ] [ -b URL ] [ -C string ] [ -e encoding ]
[ -f file[:file[:...]]  ] [ -i num ] [ -k file ] [ -l lang ] [ -m num ]
[ -M num ] [ -N num ] [ -o file ] [ -r path ] [ -s num ] [ -S string ] [
-W string ] [ -x num ] [ URL|file ]

🌈 DESCRIPTION 🌈

so. html2ps takes HTML and turns it into PostScript. literally that's her job and she eats every time πŸ’…

the HTML can come from one or more URL:s or local files, and you just hand them over as parameters on the command line. and if you give her no parameter at all? she just reads from standard input. no thoughts, head empty, stdin only ✨

note (and this one matters, bestie): to avoid unnecessary network traffic, you can rebuild an already generated PostScript file with new options. how? run html2ps with the new options and pass the old PostScript file as input. the catch β€” and there's always a catch β€” this is not applicable for all options. 😭

πŸ‘‘ OPTIONS πŸ‘‘

every single option has a short form (case sensitive) and a long form (case insensitive). pick your fighter, they're both valid πŸŽ€

  • -2, --twoup β€” two column (2-up) output. the default is one column per page.
  • -b URL, --base URL β€” use URL as a base to expand relative references for in-line images. super useful when you've downloaded a document to a local file β€” the URL you put here should be the URL of the original document. πŸ’–
  • -c, --check β€” check the syntax of the HTML file (using an external syntax checker). the default is to not make a syntax check.
  • -C string, --toc string β€” generate a table of contents (ToC). the value should be a string with one of the letters 'f', 'h', or 't', optionally combined with the letter 'b':
    • b β€” the ToC will be printed first. this requires that Ghostscript is installed.
    • f β€” the ToC will be generated from the links in the converted document.
    • h β€” the ToC will be generated from headings and titles in the converted documents. heads up: if the document author, for some strange reason, chose to represent headings with something other than the HTML elements H1,...,H6, then you are out of luck! πŸ™ˆ
    • t β€” the ToC will be generated from links having the attribute rev=TOC in the converted document.
  • -d, --debug β€” generate debugging information. you should always use this when reporting problems with html2ps, fr fr.
  • -D, --dsc, --DSC β€” generate DSC compliant PostScript. this requires Ghostscript and can take quite some time. also, and this is important: a PostScript file generated with this option cannot be used as input to html2ps for reformatting later. πŸ’€
  • -e encoding, --encoding encoding β€” the document encoding. currently recognized values are ISO-8859-1, EUC-JP, SHIFT-JIS, and ISO-2022-JP (other EUC-xx encodings may also work). the default is ISO-8859-1.
  • -f file[:file[:...]], --rcfile file[:file[:...]] β€” a colon separated list of configuration file names to use instead of the default personal configuration file $HOME/.html2psrc. definitions made in one file override definitions in previous files (the last file in the list has highest precedence). an empty file name (like in ':file', 'file1::file3', or 'file:') will expand to the default personal file. the environment variable HTML2PSPATH is used to specify the directories where to search for these files. (note: this is only supposed to be used on the command line, not in a configuration file.)
  • -F, --frame β€” draw a frame around the text on each page. the default is to not draw a frame.
  • -g, --grayscale β€” convert colour images to grayscale images. note that the PostScript file will be smaller when the images are converted to grayscale. the default is to generate colour images.
  • -h, --help β€” show usage information.
  • -H, --hyphenate β€” hyphenate the text. this requires TeX hyphenation pattern files.
  • -i num, --scaleimage num β€” scale in-line images with a factor num. the default is 1.
  • -k file, --cookie file β€” enable cookie support, using a netscape formatted cookie file (requires libwww-perl).
  • -l lang, --language lang β€” specifies the language of the document (overrides an eventual LANG attribute of the BODY element). the language should be given according to RFC1766 (ftp://ftp.nordu.net/rfc/rfc1766.txt) and ISO 639 (http://www.w3.org/WAI/ER/IG/ert/iso639.htm).
  • -L, --landscape β€” generate code for printing in landscape mode. the default is portrait mode.
  • -m num, --scalemath num β€” scale mathematical formulas with a factor num. the default is 1.
  • -M num, --mainchapter num β€” specifies the start number for automatic numbering of headings (by setting the seq-number parameter). the default is 1.
  • -n, --number β€” insert page numbers. the default is to not number the pages.
  • -N num, --startno num β€” specifies the starting page number. the default is 1.
  • -o file, --output file β€” write the PostScript code to file. the default is to write to standard output.
  • -O, --original β€” use PostScript original images if they exist. for example, if a document contains an image figure.gif, and an encapsulated PostScript file named figure.ps exists in the same directory, that file will be used instead. this only works for documents read as local files. note: if the PostScript file is large or contains bitmap images, this must be combined with the -D option. in HTML 4.0 this can be achieved in a much better way with:
<OBJECT data="figure.ps" type="application/postscript">
<OBJECT data="figure.gif" type="image/gif">
<PRE>[Maybe some ASCII art for text browsers]</PRE>
</OBJECT>
</OBJECT>
  • -r path, --rootdir path β€” when a document is read from a local file, this value specifies a base directory for resolving relative links starting with "/". typically, this should be the directory where your web server's home page resides.
  • -R, --xref β€” insert cross references at every link to within the set of converted documents.
  • -s num, --scaledoc num β€” scale the entire document with a factor num. the default is 1.
  • -S string, --style string β€” this option complements/overrides definitions made in the configuration files. the string must follow the configuration file syntax. (note: this is only supposed to be used on the command line, not in a configuration file.)
  • -t, --titlepage β€” generate a title page. the default is to not generate one.
  • -T, --text β€” text mode, ignore images. the default is to include the images.
  • -u, --underline β€” underline text that constitutes a hypertext link. the default is to not underline.
  • -U, --colour β€” produce colour output for text and background, when specified. the default is black text on white background (mnemonic: coloUr ;-).
  • -v, --version β€” print information about the current version of html2ps.
  • -W string, --web string β€” process a web of documents by recursively retrieving and converting documents that are referenced with hyperlinks. when dealing with remote documents it will, of course, be necessary to impose restrictions, to avoid downloading the entire web… 🌐 the value should be a string consisting of one of the letters 'a', 'b', 'l', 'r', or 's', optionally combined with a combination of the letters 'p', 'L', and a positive integer:
    • a β€” follow all links.
    • b β€” follow only links to within the same directory, or below, as the start document.
    • l β€” follow only links specified with "<LINK rel=NEXT>" in the document.
    • p β€” prompt for each remote document. this mode will automatically be entered after the first 50 documents.
    • r β€” follow only relative links.
    • s β€” follow only links to within the same server as the start document.
    • L β€” with this option, the order in which the documents are processed will be: first all top level documents, then the documents linked to from these etc. for example, if the document A has links to B and C, and B has a link to D, the order will be A-B-C-D. by default, each document will be followed by the first document it links to etc; so the default order for the example is A-B-D-C.
    • # β€” a positive integer giving the number of recursive levels. the default is 4 (when the option is present).
  • -x num, --duplex num β€” generate postscript code for single or double sided printing. no default, valid values are:
    • 0 β€” single sided.
    • 1 β€” double sided.
    • 2 β€” double sided, opposite page reversed (tumble mode).

😭 BUGS 😭

(this is incomplete.)

  • the CELLSPACING attribute of the TABLE element is not implemented as described in the specification; instead the value of the CELLPADDING attribute is increased by half the value of CELLSPACING.
  • rendering HTML tables well is a non-trivial task. for "real" tables β€” that is, representation of tabular data β€” html2ps usually generates reasonably good output. but when tables are used for layout purposes, the result varies from good to useless. this is because a table cell is never broken across pages. so if a table contains a cell with a lot of content, the entire table may have to be scaled down in size in order to make this cell fit on a single page. sometimes this may even result in unreadable output. πŸ’€
  • page breaks are occasionally done in bad places: for example directly after a (long) heading, and before the last line in a paragraph. πŸ™ˆ

🧚 ENVIRONMENT 🧚

  • HTML2PSPATH β€” this variable specifies the directories to search for configuration files. it should be a colon separated list of directory names. use a dot '.' to denote the current directory. an empty directory name (as in ':dir', 'dir1::dir3', or 'dir:') will expand to the directory where the global configuration file is. the default value is '.:', that is: search the current directory first, and then the global one.

πŸ“ FILES πŸ“

  • $HOME/.html2psrc β€” user configuration file, see html2psrc(5).

πŸ’œ SEE ALSO πŸ’œ

html2psrc(5), perl(1), setlocale(3), strftime(3), weblint(1)


⭐ VERSION ⭐

this manpage describes html2ps version 1.0 beta7.


🌸 AVAILABILITY 🌸

http://user.it.uu.se/~jan/html2ps.html

πŸ‘‘ AUTHOR πŸ‘‘

So who's the icon behind all of this? It's Jan Karrman, and you can slide into their inbox at jan@it.uu.se if you've got thoughts, bug reports, or just want to say thank you to the person who made your PostScript dreams come true. πŸ’–

That's it, that's the whole author section β€” one person, one email, one legend. Respect the craft, bestie. 🫢


And that's a wrap on html2ps(1), fr fr. This whole thing comes to you from the 4th Berkeley Distribution, dated 7 May 2010 β€” so yeah, it's been around a minute and it's still serving looks. πŸ’…

Go convert something gorgeous. You've got this. βœ¨πŸ¦‹πŸŒΈ