man-pages/man3/HTML::FormatPS.3pm.html
2021-03-31 01:06:50 +01:00

310 lines
7.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of HTML::FormatPS</TITLE>
</HEAD><BODY>
<H1>HTML::FormatPS</H1>
Section: User Contributed Perl Documentation (3pm)<BR>Updated: 2016-12-15<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
HTML::FormatPS - Format HTML as PostScript
<A NAME="lbAC">&nbsp;</A>
<H2>VERSION</H2>
version 2.12
<A NAME="lbAD">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
use HTML::TreeBuilder;
$tree = HTML::TreeBuilder-&gt;new-&gt;parse_file(&quot;test.html&quot;);
use HTML::FormatPS;
$formatter = HTML::FormatPS-&gt;new(
FontFamily =&gt; 'Helvetica',
PaperSize =&gt; 'Letter',
);
print $formatter-&gt;format($tree);
</PRE>
<P>
Or, for short:
<P>
<PRE>
use HTML::FormatPS;
print HTML::FormatPS-&gt;format_file(
&quot;test.html&quot;,
'FontFamily' =&gt; 'Helvetica',
'PaperSize' =&gt; 'Letter',
);
</PRE>
<A NAME="lbAE">&nbsp;</A>
<H2>DESCRIPTION</H2>
The HTML::FormatPS is a formatter that outputs PostScript code. Formatting of
<FONT SIZE="-1">HTML</FONT> tables and forms is not implemented.
<P>
HTML::FormatPS is built on top of HTML::Formatter and so further detail may
be found in the documentation for HTML::Formatter.
<P>
You might specify the following parameters when constructing the formatter
object (or when calling format_file or format_string):
<DL COMPACT>
<DT id="1">PaperSize<DD>
What kind of paper should we format for. The value can be one of these: A3,
A4, A5, B4, B5, Letter, Legal, Executive, Tabloid, Statement, Folio, 10x14,
Quarto.
<P>
The default is ``A4''.
<DT id="2">PaperWidth<DD>
The width of the paper, in points. Setting PaperSize also defines this value.
<DT id="3">PaperHeight<DD>
The height of the paper, in points. Setting PaperSize also defines this value.
<DT id="4">LeftMargin<DD>
The left margin, in points.
<DT id="5">RightMargin<DD>
The right margin, in points.
<DT id="6">HorizontalMargin<DD>
Both left and right margin at the same time. The default value is 4 cm.
<DT id="7">TopMargin<DD>
The top margin, in points.
<DT id="8">BottomMargin<DD>
The bottom margin, in points.
<DT id="9">VerticalMargin<DD>
Both top and bottom margin at the same time. The default value is 2 cm,
<DT id="10">PageNo<DD>
This parameter determines if we should put page numbers on the pages. The
default value is true; so you have to set this value to 0 in order to suppress
page numbers. (The ``No'' in ``PageNo'' means number/numero!)
<DT id="11">FontFamily<DD>
This parameter specifies which family of fonts to use for the formatting. Legal
values are ``Courier'', ``Helvetica'' and ``Times''. The default is ``Times''.
<DT id="12">FontScale<DD>
This is a scaling factor for all the font sizes. The default value is 1.
<P>
For example, if you want everything to be almost three times as large, you
could set this to 2.7. If you wanted things just a bit smaller than normal,
you could set it to .92.
<DT id="13">Leading<DD>
This option (pronounced ``ledding'', not ``leeding'') controls how much is space
between lines. This is a factor of the font size used for that line. Default
is 0.1 --- so between two 12-point lines, there will be 1.2 points of space.
<DT id="14">StartPage<DD>
Assuming you have PageNo on, StartPage controls what the page number of the
first page will be. By default, it is 1. So if you set this to 87, the first
page would say ``87'' on it, the next ``88'', and so on.
<DT id="15">NoProlog<DD>
If this option is set to a true value, HTML::FormatPS will make a point of
<I>not</I> emitting the PostScript prolog before the document. By default, this is
off, meaning that HTML::FormatPS <I>will</I> emit the prolog. This option is of
interest only to advanced users.
<DT id="16">NoTrailer<DD>
If this option is set to a true value, HTML::FormatPS will make a point of
<I>not</I> emitting the PostScript trailer at the end of the document. By default,
this is off, meaning that HTML::FormatPS <I>will</I> emit the bit of PostScript
that ends the document. This option is of interest only to advanced users.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>METHODS</H2>
<A NAME="lbAG">&nbsp;</A>
<H3>new</H3>
<PRE>
my $formatter = FormatterClass-&gt;new(
option1 =&gt; value1, option2 =&gt; value2, ...
);
</PRE>
<P>
This creates a new formatter object with the given options.
<A NAME="lbAH">&nbsp;</A>
<H2>SEE ALSO</H2>
HTML::Formatter
<A NAME="lbAI">&nbsp;</A>
<H2>ISSUES</H2>
<DL COMPACT>
<DT id="17">&bull;<DD>
Output is in <FONT SIZE="-1">ISO</FONT> Latin1 format. The underlying <FONT SIZE="-1">HTML</FONT> parsers tend to now work in
Unicode (perl native) code points. There is an impedance mismatch between
these, which may give issues with complex characters within <FONT SIZE="-1">HTML.</FONT>
</DL>
<A NAME="lbAJ">&nbsp;</A>
<H2>TO DO</H2>
<DL COMPACT>
<DT id="18">&bull;<DD>
Support for some more character styles, notably including: strike-through,
underlining, superscript, and subscript.
<DT id="19">&bull;<DD>
Support for Unicode.
<DT id="20">&bull;<DD>
Support for Win-1252 encoding, since that's what most people mean when they use
characters in the range 0x80-0x9F in <FONT SIZE="-1">HTML.</FONT>
<DT id="21">&bull;<DD>
And, if it's ever even reasonably possible, support for tables.
</DL>
<P>
I would welcome email from people who can help me out or advise me on the
above.
<A NAME="lbAK">&nbsp;</A>
<H2>INSTALLATION</H2>
See perlmodinstall for information and options on installing Perl modules.
<A NAME="lbAL">&nbsp;</A>
<H2>BUGS AND LIMITATIONS</H2>
You can make new bug reports, and view existing ones, through the
web interface at &lt;<A HREF="http://rt.cpan.org/Public/Dist/Display.html?Name=HTML-Format">http://rt.cpan.org/Public/Dist/Display.html?Name=HTML-Format</A>&gt;.
<A NAME="lbAM">&nbsp;</A>
<H2>AVAILABILITY</H2>
The project homepage is &lt;<A HREF="https://metacpan.org/release/HTML-Format">https://metacpan.org/release/HTML-Format</A>&gt;.
<P>
The latest version of this module is available from the Comprehensive Perl
Archive Network (<FONT SIZE="-1">CPAN</FONT>). Visit &lt;<A HREF="http://www.perl.com/CPAN/">http://www.perl.com/CPAN/</A>&gt; to find a <FONT SIZE="-1">CPAN</FONT>
site near you, or see &lt;<A HREF="https://metacpan.org/module/HTML::Format/">https://metacpan.org/module/HTML::Format/</A>&gt;.
<A NAME="lbAN">&nbsp;</A>
<H2>AUTHORS</H2>
<DL COMPACT>
<DT id="22">&bull;<DD>
Nigel Metheringham &lt;<A HREF="mailto:nigelm@cpan.org">nigelm@cpan.org</A>&gt;
<DT id="23">&bull;<DD>
Sean M Burke &lt;<A HREF="mailto:sburke@cpan.org">sburke@cpan.org</A>&gt;
<DT id="24">&bull;<DD>
Gisle Aas &lt;<A HREF="mailto:gisle@ActiveState.com">gisle@ActiveState.com</A>&gt;
</DL>
<A NAME="lbAO">&nbsp;</A>
<H2>COPYRIGHT AND LICENSE</H2>
This software is copyright (c) 2015 by Nigel Metheringham, 2002-2005 Sean M Burke, 1999-2002 Gisle Aas.
<P>
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="25"><A HREF="#lbAB">NAME</A><DD>
<DT id="26"><A HREF="#lbAC">VERSION</A><DD>
<DT id="27"><A HREF="#lbAD">SYNOPSIS</A><DD>
<DT id="28"><A HREF="#lbAE">DESCRIPTION</A><DD>
<DT id="29"><A HREF="#lbAF">METHODS</A><DD>
<DL>
<DT id="30"><A HREF="#lbAG">new</A><DD>
</DL>
<DT id="31"><A HREF="#lbAH">SEE ALSO</A><DD>
<DT id="32"><A HREF="#lbAI">ISSUES</A><DD>
<DT id="33"><A HREF="#lbAJ">TO DO</A><DD>
<DT id="34"><A HREF="#lbAK">INSTALLATION</A><DD>
<DT id="35"><A HREF="#lbAL">BUGS AND LIMITATIONS</A><DD>
<DT id="36"><A HREF="#lbAM">AVAILABILITY</A><DD>
<DT id="37"><A HREF="#lbAN">AUTHORS</A><DD>
<DT id="38"><A HREF="#lbAO">COPYRIGHT AND LICENSE</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:45 GMT, March 31, 2021
</BODY>
</HTML>