michaelrsweet / htmldoc

HTML Conversion Software
https://www.msweet.org/htmldoc
GNU General Public License v2.0
210 stars 47 forks source link
encryption html html-doc html-files pdf pdf-files postscript

HTMLDOC - HTML Conversion Software

Version GPL-2.0 Build Coverity Scan Status

HTMLDOC is a program that reads HTML and Markdown source files or web pages and generates corresponding EPUB, HTML, PostScript, or PDF files with an optional table of contents.

HTMLDOC was developed in the 1990's as a documentation generator for my previous company, and has since seen a lot of usage as a report generator embedded in web servers. However, it does not support many things in "the modern web", such as:

Resources

The following HTMLDOC resources are available online:

Using HTMLDOC

Note: Complete documentation for HTMLDOC is available in the "doc" subdirectory. The following provides basic information on using HTMLDOC at the command-line and does not discuss the GUI or web server functionality.

HTMLDOC accepts a list of HTML and/or Markdown "source" files and will generate EPUB, HTML, PostScript, or PDF output via command-line options. A summary of command-line options can be shown with the "--help" option:

htmldoc --help

HTMLDOC normally expects "structured" documents, with chapters, etc. Chapters begin with a H1 markup and continue to the end of the listed HTML files or the next H1 markup, whichever comes first. To convert unstructured documents such as web pages, use the "--webpage" option to HTMLDOC:

htmldoc --webpage ...

To generate a Level 2 PostScript file you might use:

htmldoc -f outfile.ps chapter1.html ... chapterN.html

Similarly you can generate an EPUB or PDF file of the same source files using:

htmldoc -f outfile.epub chapter1.html ... chapterN.html

htmldoc -f outfile.pdf chapter1.html ... chapterN.html

Finally, to generate HTML files for viewing (with a linked table-of-contents) do the following:

htmldoc -t html -d outdir chapter1.html ... chapterN.html

or:

htmldoc -t html -f outfile.html chapter1.html ... chapterN.html

A complete description of all command-line options and HTML guidelines can be found in the software users manual in the "doc" directory.

Credits

Many thanks to Leonard Rosenthol for providing the original changes to support a macOS (9) version of HTMLDOC.

The original table VALIGN and "HALF PAGE" code was contributed by D. Richard Hipp.

The original multiple header/footer image code was contributed by Lynn Pye.

The RC4 encryption code is from librc4 1.1 by the folks at Carnegie Mellon University.

The MD5 hash code is from L. Peter Deutsch at Aladdin Enterprises (creators of Ghostscript, among other things).

Legal Stuff

HTMLDOC is copyright © 1997-2024 by Michael R Sweet. This program is free software. Distribution and use rights are outlined in the file "COPYING".

HTMLDOC includes code to encrypt PDF document files using the RC4 algorithm with up to a 128-bit key. While this software and code may be freely used and exported under current US laws, other countries may restrict your use and possession of this code and software.

The Adobe Portable Document Format is Copyright 1985-2005 by Adobe Systems Incorporated. Adobe, FrameMaker, and PostScript are registered trademarks of Adobe Systems, Incorporated.

The Graphics Interchange Format is the copyright and GIF is the service mark property of CompuServe Incorporated.

Linux is a registered trademark of Linus Torvalds.

macOS is a registered trademark of Apple Inc.

Microsoft and Windows are registered trademarks of Microsoft Corporation.

UNIX is a registered trademark of the X/Open Company, Ltd.

This software is based in part on the work of the Independent JPEG Group and FLTK project.