html2ps(1)
π 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β useURLas 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 elementsH1,...,H6, then you are out of luck! πtβ the ToC will be generated from links having the attributerev=TOCin the converted document.
-d,--debugβ generate debugging information. you should always use this when reporting problems withhtml2ps, 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 tohtml2psfor reformatting later. π-e encoding,--encoding encodingβ the document encoding. currently recognized values areISO-8859-1,EUC-JP,SHIFT-JIS, andISO-2022-JP(otherEUC-xxencodings may also work). the default isISO-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 variableHTML2PSPATHis 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 factornum. the default is1.-k file,--cookie fileβ enable cookie support, using a netscape formatted cookie file (requireslibwww-perl).-l lang,--language langβ specifies the language of the document (overrides an eventualLANGattribute of theBODYelement). 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 factornum. the default is1.-M num,--mainchapter numβ specifies the start number for automatic numbering of headings (by setting theseq-numberparameter). the default is1.-n,--numberβ insert page numbers. the default is to not number the pages.-N num,--startno numβ specifies the starting page number. the default is1.-o file,--output fileβ write the PostScript code tofile. the default is to write to standard output.-O,--originalβ use PostScript original images if they exist. for example, if a document contains an imagefigure.gif, and an encapsulated PostScript file namedfigure.psexists 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-Doption. 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 factornum. the default is1.-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 ofhtml2ps.-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 documentAhas links toBandC, andBhas a link toD, the order will beA-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 isA-B-D-C.#β a positive integer giving the number of recursive levels. the default is4(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
CELLSPACINGattribute of theTABLEelement is not implemented as described in the specification; instead the value of theCELLPADDINGattribute is increased by half the value ofCELLSPACING. - rendering HTML tables well is a non-trivial task. for "real" tables β that is, representation of tabular data β
html2psusually 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, seehtml2psrc(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. β¨π¦πΈ
π¦ where this page comes from
- debian bookworm: html2ps 1.0b7-6 Β· GPL-2.0-or-later
- debian trixie: html2ps 1.0b7-6 Β· GPL-2.0-or-later
- epel 9: html2ps 1.0-0.53.b7.el9 Β· GPL-2.0-or-later
- fedora 43: html2ps 1.0-0.57.b7.fc43 Β· GPL-2.0-or-later
- fedora 44: html2ps 1.0-0.58.b7.fc44 Β· GPL-2.0-or-later
- ubuntu jammy: html2ps 1.0b7-5 Β· GPL-2.0-or-later
- ubuntu noble: html2ps 1.0b7-6 Β· GPL-2.0-or-later
- ubuntu questing: html2ps 1.0b7-6
- ubuntu resolute: html2ps 1.0b7-7 Β· GPL-2.0-or-later
- ubuntu stonking: html2ps 1.0b7-7 Β· 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