Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<html>
2
<head>
3
<title>html2ps/html2pdf configuration files and options</title>
4
<link rel="stylesheet" type="text/css" medial="all" title="Default" href="css/help.css"/>
5
</head>
6
<body>
7
<h1>html2ps/pdf configuration files and options</h1>
8
<p><a href="index.html">Back to table of contents</a></p>
9
 
10
<p>Currently, configuration is done both via configuration file (<tt>html2ps.config</tt>)
11
  and configuration constants inside the <tt>config.inc.php</tt> file.
12
<h2><a name="common"></a>html2ps.config, Common configuration options</h2>
13
<table class="description_table">
14
  <caption><p>Common directives in <tt>html2ps.config<br>
15
  </tt></p></caption>
16
  <tr class="odd">
17
    <th style="width: 10%;">Option</th>
18
    <th style="width: 10%;">Appears&nbsp;at</th>
19
    <th style="width: 90%;">Description</th>
20
  </tr>
21
  <tr class="even">
22
    <td><tt>media</tt></td>
23
    <td>Top level</td>
24
    <td> Defines the output media size. This tag should have three arguments:
25
      <ul>
26
        <li><tt>name</tt> &ndash; media name; you'll be able to refer to this media
27
          by name while calling the script;</li>
28
        <li><tt>width</tt> &ndash; media width in millimetres;</li>
29
        <li><tt>height</tt> &ndash; media height in millimetres.</li>
30
      </ul>
31
    </td>
32
  </tr>
33
</table>
34
 
35
<h2><a name="postscript"></a>html2ps.config, Postscript and Ghotscript configuration</h2>
36
<table class="description_table">
37
  <caption><p>Postscript-specific directives in <tt>html2ps.config<br></tt></p>
38
  </caption>
39
  <tr class="odd">
40
    <th style="width: 10%;">Option</th>
41
    <th style="width: 10%;">Appears&nbsp;at</th>
42
    <th style="width: 90%;">Description</th>
43
  </tr>
44
  <tr class="even">
45
    <td><tt>fonts</tt></td>
46
    <td>Top level</td>
47
    <td>Contains information about font-family value to Postscript font name mappings.
48
      See descrripton of nested directives.</td>
49
  </tr>
50
  <tr class="odd">
51
    <td><tt>family</tt></td>
52
    <td>/fonts</td>
53
    <td>Contains information about particular font-family value mapping. Attributes:
54
      <ul>
55
        <li><tt>name</tt> &ndash; value of 'font-family' property being mapped.</li>
56
      </ul>
57
    </td>
58
  </tr>
59
  <tr class="even">
60
    <td><tt>encoding-override</tt></td>
61
    <td>/fonts, /fonts/family</td>
62
    <td>Contains information about exceptions in font-family mappings. Attributes:
63
      <ul>
64
        <li><tt>name</tt> &ndash; comma-separated list of encodings to apply this rule
65
          for.</li>
66
      </ul>
67
      For example, normally 'times' family is mapped to /Times-Roman font. On
68
      the other hand, this standard font does not contain cyrillic symbols, so
69
      when one of the cyrillic encodings is met, 'times' will be mapped to /TimesCyr-Medium.</td>
70
  </tr>
71
  <tr class="odd">
72
    <td><tt>alias</tt></td>
73
    <td>/fonts</td>
74
    <td>List of font-family aliases. Attributes:
75
      <ul>
76
        <li><tt>alias</tt> &ndash; font family alias to be translated</li>
77
        <li><tt>family</tt> &ndash; real font family name for this alias</li>
78
      </ul>
79
      Note that alias resolving is done once, so there's not much use of constructions
80
      similar to
81
      <pre>
82
  &lt;alias alias=&quot;verdana&quot; family=&quot;arial&quot;/&gt;
83
  &lt;alias alias=&quot;arial&quot; family=&quot;helvetica&quot;/&gt;
84
</pre>
85
    </td>
86
  </tr>
87
 
88
  <tr class="even">
89
    <td><tt>metrics</tt></td>
90
    <td>/fonts</td>
91
    <td>
92
      Reference to a font metric file for this font family. Attributes:
93
      <ul>
94
      <li><tt>typeface</tt> &ndash; typeface name (refers to the ones used in <tt>normal</tt>,
95
          <tt>italic</tt> and <tt>oblique</tt> attributes)</li>
96
      <li><tt>file</tt> &ndash; name of the font metric (AFM) file (searched in TYPE1_FONT_REPOSITORY directory)</li>
97
      </ul>
98
    </td>
99
  </tr>
100
 
101
  <tr class="odd">
102
    <td><tt>normal</tt></td>
103
    <td>/fonts/family, /fonts/family/encoding-override, /encoding-override</td>
104
    <td>System font names for normal font variant. Attributes:
105
      <ul>
106
        <li><tt>normal</tt> &ndash; font name for roman (non-italic) font</li>
107
        <li><tt>italic</tt> &ndash; font name for italic font</li>
108
        <li><tt>oblique</tt> &ndash; font name for oblique font</li>
109
      </ul>
110
    </td>
111
  </tr>
112
  <tr class="even">
113
    <td><tt>bold</tt></td>
114
    <td>/fonts/family, /fonts/family/encoding-override, /encoding-override</td>
115
    <td>System font names for bold font variant. Attributes:
116
      <ul>
117
        <li><tt>normal</tt> &ndash; font name for bold roman (non-italic) font</li>
118
        <li><tt>italic</tt> &ndash; font name for bold italic font</li>
119
        <li><tt>oblique</tt> &ndash; font name for bold oblique font</li>
120
      </ul>
121
    </td>
122
  </tr>
123
</table>
124
 
125
<h2><a name="pdflib"></a>html2ps, config PDFLIB/FPDF configuration</h2>
126
<table class="description_table">
127
<caption><p>PDFLIB-specific directives in <tt>html2ps.config</tt></p></caption>
128
<tr class="odd">
129
<th style="width: 10%;">Option</th>
130
<th style="width: 10%;">Appears&nbsp;at</th>
131
<th style="width: 90%;">Description</th>
132
</tr>
133
 
134
<tr class="even">
135
<td><tt>fonts-pdf</tt></td>
136
<td>Top level</td>
137
    <td>Contains information about font-family value to PDF font name mappings.
138
      Note that nested directives and their meanings are the same as for the <tt>fonts</tt>
139
      directive, except that they're applied when PDFLIB is used.</td>
140
</tr>
141
 
142
<tr class="odd">
143
<td><tt>ttf</tt></td>
144
<td>fonts-pdf</td>
145
<td>Defines mapping of typefaces to available TrueType fonts. Attributes:
146
<ul>
147
<li><tt>typeface</tt> &ndash; typeface name (refers to the ones used in <tt>normal</tt>, <tt>italic</tt> and <tt>oblique</tt> attributes)</li>
148
<li><tt>file</tt> &ndash; name of the TTF file (searched in TTF_FONTS_REPOSITORY directory)
149
<li><tt>embed</tt> &ndash; flag indicating whether this font file should be embedded in generated PDF (0 - not embedded, 1 - embedded).</ul>
150
</td>
151
</tr>
152
</table>
153
 
154
<h2><a name="constants-common"></a>config.inc.php, Common configuration options</h2>
155
 
156
<table class="description_table">
157
<caption><p>Common configuration constants</p></caption>
158
<tr class="odd">
159
<th>Name</th>
160
<th>Description</th>
161
</tr>
162
 
163
<tr class="even">
164
<td>HTML2PS_DIR</td>
165
<td>
166
Path to directory on server where HTML2PS script files reside. All HTML2PS-specific directories and
167
paths are relative to this directory.
168
</td>
169
</tr>
170
 
171
<tr class="odd">
172
<td>DEFAULT_USER_AGENT</td>
173
<td>
174
Value of the 'User-Agent' HTTP header which will be sent by PHP when fetching files from remote server.
175
</td>
176
</tr>
177
 
178
<tr class="even">
179
<td>OUTPUT_DEFAULT_NAME</td>
180
<td>
181
Default PDF or PS file name to use when no filename have been specified via API.
182
</td>
183
</tr>
184
 
185
<tr class="odd">
186
<td>DEFAULT_ENCODING</td>
187
<td>
188
Default encoding to use when no encoding information is available (e.g. encoding was specified neither in
189
HTTP headers nor in META tag of HTML page).
190
</td>
191
</tr>
192
 
193
<tr class="even">
194
<td>FILE_PROTOCOL_RESTRICT</td>
195
<td>
196
Determines the prefix of the filesystem path allowed to be referred via 'file' protocol. By default,
197
you may refer files in html2ps directory and below; to use files from <tt>C:\images</tt> directory you'll need to
198
store <tt>C:\images\</tt> value in this constant. Note the trailing backslash; if it is omitted, the prefix may match several directories,
199
e.g. both <tt><b>C:\images</b>\</tt> and <tt><b>C:\images</b>-private\</tt>.
200
</td>
201
</tr>
202
 
203
<tr class="odd">
204
<td id="font_embedding_mode">FONT_EMBEDDING_MODE</td>
205
<td>
206
Determines how font files are embedded. May be:
207
<ul>
208
<li>'all' &mdash; embed all fonts</li>
209
<li>'none' &mdash; do not embed any fonts</li>
210
<li>'config' &mdash; whether font is embedded is determined by html2ps.config 'embed' attribute value for this font</li>
211
</ul>
212
</td>
213
</tr>
214
 
215
</table>
216
 
217
<h2><a name="constants-ps"></a>config.inc.php, Postscript options</h2>
218
<table class="description_table">
219
<caption><p>Postscript-related constants</p></caption>
220
<tr class="odd">
221
<th>Name</th>
222
<th>Description</th>
223
</tr>
224
 
225
<tr class="even">
226
<td>GS_PATH</td>
227
<td>
228
Path to your Ghostscript executable. Note to Windows users! Ghostscript distribution includes two executables: gswin32.exe
229
(GUI version) and gswin32c.exe (command-line version). You should provide path to <strong>command-line</strong> version
230
only!
231
</td>
232
</tr>
233
 
234
<tr class="odd">
235
<td>TYPE1_FONTS_REPOSITORY</td>
236
<td>
237
Path to font metric (AFM) files. Usually AFM files are packaged together with Ghostscript in 'fonts' subdirectory;
238
in some Linux distibutions you should install 'ghostscript-fonts' package to get font metrics.
239
</td>
240
</tr>
241
 
242
</table>
243
 
244
<h2><a name="constants-pdflib"></a>config.inc.php, PDFLIB options</h2>
245
<table class="description_table">
246
<caption><p>PDFLIB-related constants</p></caption>
247
<tr class="odd">
248
<th>Name</th>
249
<th>Description</th>
250
</tr>
251
 
252
<tr class="even">
253
<td>PDFLIB_DL_PATH</td>
254
<td>
255
Path to PDFLIB dynamically loaded library. If no "pdf" extension loaded, script attempts to call "dl" with
256
PDFLIB_DF_PATH as argument.
257
</td>
258
</tr>
259
 
260
<tr class="odd">
261
<td>PDFLIB_LICENSE</td>
262
<td>
263
Your PDFLIB license key.
264
</td>
265
</tr>
266
 
267
<tr class="even">
268
<td>TTF_FONTS_REPOSITORY</td>
269
<td>
270
Path to directory containing a set of True-Type font files to be used by PDFLIB.
271
</td>
272
</tr>
273
 
274
</table>
275
 
276
</body>
277
</html>