[5548] in RedHat Linux List
Re: HTML to PS or TIFF
daemon@ATHENA.MIT.EDU (Jacques BONNEVILLE)
Fri Nov 22 03:13:45 1996
From: Jacques BONNEVILLE <bonnev@bat710.univ-lyon1.fr>
To: redhat-list@redhat.com
Date: Fri, 22 Nov 1996 09:12:08 +0100 (MET)
In-Reply-To: <199611212141.PAA06134@babba.cu-online.com> from "Otto Hammersmith" at Nov 21, 96 03:41:39 pm
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com
Hi,
Here is the README of a package doing this work :
This is html2ps 0.2 alpha, an HTML-to-PostScript converter.
Copyright (C) 1995 Jan Karrman.
This version of html2ps is written in Perl. Perl is available from any
comp.sources.misc archive.
The latest version of html2ps is available by anonymous ftp from
"ftp://ftp.tdb.uu.se/pub/sources/html2ps/".
Some PostScript code and some ideas have been taken from the PostScript
generator in NCSA's Mosaic, by Ameet A. Raval & Frans van Hoesel.
The program has been developed and tested on different Suns running
Solaris 2.3 with perl version 5.000, and SunOS 4.1.3 with perl version 4.0.
Send all mails regarding html2ps to html2ps-request@tdb.uu.se.
There is a mailing list for information about html2ps. Send a mail if you
would like to be on the list.
Features
* New features in version 0.2:
+ Inline images are now supported. The conversion of images to
PostScript requires that you have some additional image
package installed. To convert gif images, you must have one
of ImageMagick, pbmplus or netpbm installed. To convert jpeg
images, you must have either ImageMagick with jpeg support,
or djpeg from the jpegsrc distribution. The conversion of
xbm-files is done by html2ps.
Actually, due to the power of these image conversion
packages, many other image formats can be used for inline
images.
+ Documents and images may be retrieved as URL:s, as well as
local files. The program lynx is used to fetch documents and
images given as URL:s.
+ The size of the inline images can be changed independently of
the rest of the document.
+ Colour images can be converted to grayscale.
+ The transparent colour in gif images (if present) is
converted to white.
+ A base URL may be specified when the document is read out of
context. This is used to resolve relative URL:s within the
document.
+ IMPORTANT: To avoid unnecessary network traffic, one can
rebuild an already generated PostScript file with new
options. This is done by running html2ps with the new
options, and with the old PostScript file as input. (Only a
subset of the command line options are applicable.)
+ Two column output can be generated.
+ PostScript code for printers with duplex (double-sided
printing) capacity can be generated (I have no such printer
available myself, so I have not been able to test the code).
+ Left or right footer text can be inserted. (Suggested by John
Bowe, bowe@osf.org, who also supplied the code.)
+ The proposed HTML3 attributes ALIGN=CENTER and ALIGN=RIGHT
for paragraphs and headers are implemented.
* Most HTML2 tags are handled. See Notes/Bugs below for exceptions.
* Scaling of the text to any size is possible (the line and page
breaks will off course be adjusted to fit the page).
* It is possible to change the sizes and styles for all the 6 header
levels individually.
* The font size used for preformatted text may be changed.
* The size of the page can be adjusted. The defaults are adapted to
the A4 paper size.
* The margin sizes may be changed.
* Different fonts can be selected. You can easily add new fonts, an
example is given in the Perl script.
* Printing in landscape mode is supported.
* Anchor texts are underlined by default, this can be turned off.
* No syntax check of the HTML code is done by the converter, but it
is possible to call an external HTML checker, specified via the
command line options. The default syntax checker is weblint.
* Page numbers can be inserted.
* A heading tag will cause a page break if the text is close to the
end of a page.
* Highlighting tags is additively interpreted. For example, the HTML
code "<B><I>some text</I></B>" would produce bold italic text.
This can be turned off so only the innermost tag is interpreted
(here, the italics).
* You can force a page break by including the comment <!--NewPage-->
in the HTML document, at the point you want the page break. (This
action is not defined in the HTML specification. I would like to
have a special character (eg &page;), ignored by screen browsers,
but used to force a page break when printing a document.)
* Netscape's tag <BLINK> is not implemented ;-)
Notes/Bugs:
* The script is rather slow when generating PostScript colour
images. Note the -g option for conversion of colour images to
grayscale. With this option the conversion will be done faster,
and the generated PostScript code will be more compact.
* The <ISINDEX> tag is not implemented. -- Ignored.
* The <FORM> and associated tags are not implemented. -- Ignored.
* <PRE WIDTH=...> is not implemented. -- Handled as <PRE>. Note that
preformatted text can be scaled independently of the rest of the
document with the -p option.
* The text between two HTML tags or special characters will be
converted into one PostScript string. If there is a large chunk of
text between two successive HTML tags (typically between <PRE> and
</PRE> tags), the length of the PostScript string may exceed some
limitations in the PostScript printer/viewer. As a work around,
you can insert a few HTML comments in the document.
* The string "<PLAINTEXT>" in an HTML document terminates the HTML
entity, even if it is within an <XMP> or <LISTING> element. The
tags <XMP>, <LISTING> and <PLAINTEXT> are obsolete, you should use
<PRE> instead.
* The PostScript code generated by html2ps is not compliant with the
Document Structuring Conventions. This is because the line
breaking (and hence the page breaking) is done within the
PostScript code itself. So the %%Page and %%Pages comments cannot
be generated in advance.
* A line break may occur at the position of a tag. For example, the
code "It looks <EM>awful</EM>. Hopefully it will be fixed.", may
give a line break between the word "awful" and the period.
ToDo
Try to fix as much as possible in the Notes/Bugs section.
Start looking at some of the suggested features in HTML3.
Write some configuration script.
Installation
I have only tested html2ps on Unix systems myself. Version 0.1 seems
to have worked under MS-DOS and Windows NT. I would like to hear your
experiences with installing the present version on different platforms.
Since html2ps is written in Perl, you must of course have Perl installed.
If you want to make use of the support for inline images, you must have
one of the packages ImageMagick, pbmplus or netpbm installed. If you do
not have ImageMagick (or if it is not installed with jpeg support), you
can use djpeg from the jpegsrc distribution to handle jpeg images. You
must also set your search path to include the commands from these
packages.
To retreive documents from URL:s over the network, you must have lynx
installed (if you have some other means for fetching URL:s, it is very
simple to modify the code).
If you are on a UNIX system and have ImageMagick installed with jpeg
support, you should not need to do any configuring. Otherwise, edit
the Perl script (at the beginning, just below the copyright notice)
and follow the instructions there.
Make the Perl script executable (chmod 755 html2ps). To convert
an HTML file to PostScript, call the script with the HTML-file as
parameter. Use the -o option to save the PostScript code to a file,
or redirect the output in standard UNIX manner. For example:
html2ps test.html > test.ps
If you want to use the syntax check feature, you have to install some
HTML syntax check program. The default program is weblint.
The file html2ps.1 is a manual page, move it to a directory where the
manual pages are kept, and read it with 'man html2ps'. There is also
a plaintext version in the file manpage.txt.
Where to find software
These programs are available from a lot of places. An archie search
will probably give you ftp archives closer to your site.
ImageMagick - ftp://ftp.x.org/contrib/
pbmplus - ftp://sunsite.unc.edu/pub/X11/contrib/
netpbm - ftp://ikaros.fysik4.kth.se/pub/netpbm/
jpegsrc - ftp://ftp.uu.net/graphics/jpeg/
weblint - ftp://ftp.khoros.unm.edu/pub/perl/www/
lynx - ftp://ftp2.cc.ukans.edu/pub/lynx/
History
* 12 Dec 1994: Version 0.1 beta released.
* 7 Apr 1994: Version 0.2 alpha released.
Added support for inline images.
Documents can now be retrieved from URL:s.
Added duplex printing support.
Left or right footer text can be inserted (John Bowe).
Added support for the HTML3 attributes ALIGN=CENTER and
ALIGN=RIGHT for paragraphs and headers.
Replaced 8bit characters with octal constants.
Minor bug fixes and changes of cosmetic character.
Thanks
Here are some persons that have given me help and suggestions. It is far
from complete, but anyway:
John Bowe, bowe@osf.org
Neil Bowers, neilb@khoros.unm.edu
Reinhard Denner, ide@unicorn.muc.de
Dave Raggett, dsr@w3.org
John Sinues, sinues@prcd.prc.mrms.navy.mil
Larry W. Virden, larry.virden@cas.org
---
Jan Karrman
Dept. of Scientific Computing
Uppsala University
Sweden
jan@tdb.uu.se
--
____________________________________________________________________________
Jacques BONNEVILLE
Tel : 72 44 80 00
Poste 42 39
LISI UNIVERSITE CLAUDE BERNARD LYON 1
Batiment 710
43 Boulevard du 11 Novembre 1918
F-69622 Villeurbanne Cedex
E-MAIL : Jacques.BONNEVILLE@lisisun.univ-lyon1.fr
____________________________________________________________________________
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
________________________________________________________________________
http://www.redhat.com/RedHat-FAQ http://www.redhat.com/RedHat-Errata
http://www.redhat.com/RedHat-Tips http://www.redhat.com/mailing-lists
------------------------------------------------------------------------
To unsubscribe: mail -s unsubscribe redhat-list-request@redhat.com < /dev/null