1HTML::FormatRTF(3) User Contributed Perl Documentation HTML::FormatRTF(3)
2
3
4
6 HTML::FormatRTF - Format HTML as RTF
7
9 version 2.10
10
12 use HTML::FormatRTF;
13
14 my $out_file = "test.rtf";
15 open(RTF, ">$out_file")
16 or die "Can't write-open $out_file: $!\nAborting";
17
18 print RTF HTML::FormatRTF->format_file(
19 'test.html',
20 'fontname_headings' => "Verdana",
21 );
22 close(RTF);
23
25 HTML::FormatRTF is a class for objects that you use to convert HTML to
26 RTF. There is currently no proper support for tables or forms.
27
28 This is a subclass of HTML::Formatter, whose documentation you should
29 consult for more information on underlying methods such as "new",
30 "format", "format_file" etc
31
32 You can specify any of the following parameters in the call to "new",
33 "format_file", or "format_string":
34
35 lm Amount of extra indenting to apply to the left margin, in twips
36 (twentieths of a point). Default is 0.
37
38 So if you wanted the left margin to be an additional half inch
39 larger, you'd set "lm => 720" (since there's 1440 twips in an
40 inch). If you wanted it to be about 1.5cm larger, you'd set "lw =>
41 850" (since there's about 567 twips in a centimeter).
42
43 rm Amount of extra indenting to apply to the left margin, in twips
44 (twentieths of a point). Default is 0.
45
46 normal_halfpoint_size
47 This is the size of normal text in the document, in half-points.
48 The default value is 22, meaning that normal text is in 11 point.
49
50 header_halfpoint_size
51 This is the size of text used in the document's page-header, in
52 half-points. The default value is 17, meaning that normal text is
53 in 7.5 point. Currently, the header consists just of
54 "p.pagenumber" in the upper-right-hand corner, and cannot be
55 disabled.
56
57 head1_halfpoint_size ... head6_halfpoint_size
58 These control the font size of each heading level, in half-twips.
59 For example, the default for head3_halfpoint_size is 25, meaning
60 that HTML "<h3>...</h3>" text will be in 12.5 point text (in
61 addition to being underlined and in the heading font).
62
63 codeblock_halfpoint_size
64 This controls the font size (in half-points) of the text used for
65 "<pre>...</pre>" text. By default, it is 18, meaning 9 point.
66
67 fontname_body
68 This option controls what font is to be used for the body of the
69 text -- that is, everything other than heading text and text in
70 pre/code/tt elements. The default value is currently "Times".
71 Other handy values I can suggest using are "Georgia" or "Bookman
72 Old Style".
73
74 fontname_code
75 This option controls what font is to be used for text in
76 pre/code/tt elements. The default value is currently "Courier New".
77
78 fontname_headings
79 This option controls what font name is to be used for headings.
80 You can use the same font as fontname_body, but I prefer a sans-
81 serif font, so the default value is currently "Arial". Also
82 consider "Tahoma" and "Verdana".
83
84 document_language
85 This option controls what Microsoft language number will be
86 specified as the language for this document. The current default
87 value is 1033, for US English. Consult an RTF reference for other
88 language numbers.
89
90 hr_width
91 This option controls how many underline characters will be used for
92 rendering a "<hr>" tag. Its default value is currently 50. You can
93 usually leave this alone, but under some circumstances you might
94 want to use a smaller or larger number.
95
96 no_prolog
97 If this option is set to a true value, HTML::FormatRTF will make a
98 point of not emitting the RTF prolog before the document. By
99 default, this is off, meaning that HTML::FormatRTF will emit the
100 prolog. This option is of interest only to advanced users.
101
102 no_trailer
103 If this option is set to a true value, HTML::FormatRTF will make a
104 point of not emitting the RTF trailer at the end of the document.
105 By default, this is off, meaning that HTML::FormatRTF will emit the
106 bit of RTF that ends the document. This option is of interest only
107 to advanced users.
108
110 HTML::Formatter, RTF::Writer
111
113 See perlmodinstall for information and options on installing Perl
114 modules.
115
117 No bugs have been reported.
118
119 Please report any bugs or feature requests through the web interface at
120 http://rt.cpan.org/Public/Dist/Display.html?Name=HTML-Format
121 <http://rt.cpan.org/Public/Dist/Display.html?Name=HTML-Format>.
122
124 The project homepage is http://search.cpan.org/dist/HTML-Format
125 <http://search.cpan.org/dist/HTML-Format>.
126
127 The latest version of this module is available from the Comprehensive
128 Perl Archive Network (CPAN). Visit <http://www.perl.com/CPAN/> to find
129 a CPAN site near you, or see http://search.cpan.org/dist/HTML-Format/
130 <http://search.cpan.org/dist/HTML-Format/>.
131
132 The development version lives at http://github.com/nigelm/html-format
133 <http://github.com/nigelm/html-format> and may be cloned from
134 git://github.com/nigelm/html-format.git <git://github.com/nigelm/html-
135 format.git>. Instead of sending patches, please fork this project
136 using the standard git and github infrastructure.
137
139 · Nigel Metheringham <nigelm@cpan.org>
140
141 · Sean M Burke <sburke@cpan.org>
142
143 · Gisle Aas <gisle@ActiveState.com>
144
146 This software is copyright (c) 2011 by Nigel Metheringham, 2002-2005
147 Sean M Burke, 1999-2002 Gisle Aas.
148
149 This is free software; you can redistribute it and/or modify it under
150 the same terms as the Perl 5 programming language system itself.
151
152
153
154perl v5.12.3 2011-08-22 HTML::FormatRTF(3)