~mcfletch/eric/update-to-4.5.13

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html><head>
<title>eric4.QScintilla.Exporters.ExporterPDF</title>
<style>
body {
    background:white;
    margin: 0em 1em 10em 1em;
    color: black;
}

h1 { color: white; background: #4FA4FF; }
h2 { color: white; background: #4FA4FF; }
h3 { color: white; background: #00557F; }
h4 { color: white; background: #00557F; }
    
a { color: #AA5500; }

</style>
</head>
<body><a NAME="top" ID="top"></a>
<h1>eric4.QScintilla.Exporters.ExporterPDF</h1>
<p>
Module implementing an exporter for PDF.
</p>
<h3>Global Attributes</h3>
<table>
<tr><td>PDF_ENCODING</td></tr><tr><td>PDF_FONTSIZE_DEFAULT</td></tr><tr><td>PDF_FONT_DEFAULT</td></tr><tr><td>PDF_MARGIN_DEFAULT</td></tr><tr><td>PDF_SPACING_DEFAULT</td></tr><tr><td>PDFfontAscenders</td></tr><tr><td>PDFfontDescenders</td></tr><tr><td>PDFfontNames</td></tr><tr><td>PDFfontWidths</td></tr><tr><td>PDFpageSizes</td></tr>
</table>
<h3>Classes</h3>
<table>
<tr>
<td><a href="#ExporterPDF">ExporterPDF</a></td>
<td>Class implementing an exporter for PDF.</td>
</tr><tr>
<td><a href="#PDFObjectTracker">PDFObjectTracker</a></td>
<td>Class to conveniently handle the tracking of PDF objects so that the cross-reference table can be built (PDF1.4Ref(p39)) All writes to the file are passed through a PDFObjectTracker object.</td>
</tr><tr>
<td><a href="#PDFRender">PDFRender</a></td>
<td>Class to manage line and page rendering.</td>
</tr><tr>
<td><a href="#PDFStyle">PDFStyle</a></td>
<td>Simple class to store the values of a PDF style.</td>
</tr>
</table>
<h3>Functions</h3>
<table>
<tr><td>None</td></tr>
</table>
<hr /><hr />
<a NAME="ExporterPDF" ID="ExporterPDF"></a>
<h2>ExporterPDF</h2>
<p>
    Class implementing an exporter for PDF.
</p>
<h3>Derived from</h3>
ExporterBase
<h3>Class Attributes</h3>
<table>
<tr><td>None</td></tr>
</table>
<h3>Class Methods</h3>
<table>
<tr><td>None</td></tr>
</table>
<h3>Methods</h3>
<table>
<tr>
<td><a href="#ExporterPDF.__init__">ExporterPDF</a></td>
<td>Constructor</td>
</tr><tr>
<td><a href="#ExporterPDF.__getPDFRGB">__getPDFRGB</a></td>
<td>Private method to convert a color object to the correct PDF color.</td>
</tr><tr>
<td><a href="#ExporterPDF.exportSource">exportSource</a></td>
<td>Public method performing the export.</td>
</tr>
</table>
<h3>Static Methods</h3>
<table>
<tr><td>None</td></tr>
</table>
<a NAME="ExporterPDF.__init__" ID="ExporterPDF.__init__"></a>
<h4>ExporterPDF (Constructor)</h4>
<b>ExporterPDF</b>(<i>editor, parent = None</i>)
<p>
        Constructor
</p><dl>
<dt><i>editor</i></dt>
<dd>
reference to the editor object (QScintilla.Editor.Editor)
</dd><dt><i>parent</i></dt>
<dd>
parent object of the exporter (QObject)
</dd>
</dl><a NAME="ExporterPDF.__getPDFRGB" ID="ExporterPDF.__getPDFRGB"></a>
<h4>ExporterPDF.__getPDFRGB</h4>
<b>__getPDFRGB</b>(<i>color</i>)
<p>
        Private method to convert a color object to the correct PDF color.
</p><dl>
<dt><i>color</i></dt>
<dd>
color object to convert (QColor)
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
PDF color description (string)
</dd>
</dl><a NAME="ExporterPDF.exportSource" ID="ExporterPDF.exportSource"></a>
<h4>ExporterPDF.exportSource</h4>
<b>exportSource</b>(<i></i>)
<p>
        Public method performing the export.
</p>
<div align="right"><a href="#top">Up</a></div>
<hr /><hr />
<a NAME="PDFObjectTracker" ID="PDFObjectTracker"></a>
<h2>PDFObjectTracker</h2>
<p>
    Class to conveniently handle the tracking of PDF objects
    so that the cross-reference table can be built (PDF1.4Ref(p39))
    All writes to the file are passed through a PDFObjectTracker object.
</p>
<h3>Derived from</h3>
object
<h3>Class Attributes</h3>
<table>
<tr><td>None</td></tr>
</table>
<h3>Class Methods</h3>
<table>
<tr><td>None</td></tr>
</table>
<h3>Methods</h3>
<table>
<tr>
<td><a href="#PDFObjectTracker.__init__">PDFObjectTracker</a></td>
<td>Constructor</td>
</tr><tr>
<td><a href="#PDFObjectTracker.add">add</a></td>
<td>Public method to add a new object.</td>
</tr><tr>
<td><a href="#PDFObjectTracker.write">write</a></td>
<td>Public method to write the data to the file.</td>
</tr><tr>
<td><a href="#PDFObjectTracker.xref">xref</a></td>
<td>Public method to build the xref table.</td>
</tr>
</table>
<h3>Static Methods</h3>
<table>
<tr><td>None</td></tr>
</table>
<a NAME="PDFObjectTracker.__init__" ID="PDFObjectTracker.__init__"></a>
<h4>PDFObjectTracker (Constructor)</h4>
<b>PDFObjectTracker</b>(<i>file</i>)
<p>
        Constructor
</p><dl>
<dt><i>file</i></dt>
<dd>
file object open for writing (file)
</dd>
</dl><a NAME="PDFObjectTracker.add" ID="PDFObjectTracker.add"></a>
<h4>PDFObjectTracker.add</h4>
<b>add</b>(<i>objectData</i>)
<p>
        Public method to add a new object.
</p><dl>
<dt><i>objectData</i></dt>
<dd>
data to be added (integer or string)
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
object number assigned to the supplied data (integer)
</dd>
</dl><a NAME="PDFObjectTracker.write" ID="PDFObjectTracker.write"></a>
<h4>PDFObjectTracker.write</h4>
<b>write</b>(<i>objectData</i>)
<p>
        Public method to write the data to the file.
</p><dl>
<dt><i>objectData</i></dt>
<dd>
data to be written (integer or string)
</dd>
</dl><a NAME="PDFObjectTracker.xref" ID="PDFObjectTracker.xref"></a>
<h4>PDFObjectTracker.xref</h4>
<b>xref</b>(<i></i>)
<p>
        Public method to build the xref table.
</p><dl>
<dt>Returns:</dt>
<dd>
file offset of the xref table (integer)
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr /><hr />
<a NAME="PDFRender" ID="PDFRender"></a>
<h2>PDFRender</h2>
<p>
    Class to manage line and page rendering. 
</p><p>
    Apart from startPDF, endPDF everything goes in via add() and nextLine()
    so that line formatting and pagination can be done properly.
</p>
<h3>Derived from</h3>
object
<h3>Class Attributes</h3>
<table>
<tr><td>None</td></tr>
</table>
<h3>Class Methods</h3>
<table>
<tr><td>None</td></tr>
</table>
<h3>Methods</h3>
<table>
<tr>
<td><a href="#PDFRender.__init__">PDFRender</a></td>
<td>Constructor</td>
</tr><tr>
<td><a href="#PDFRender.add">add</a></td>
<td>Public method to add a character to the page.</td>
</tr><tr>
<td><a href="#PDFRender.endPDF">endPDF</a></td>
<td>Public method to end the PDF document.</td>
</tr><tr>
<td><a href="#PDFRender.endPage">endPage</a></td>
<td>Public method to end a page.</td>
</tr><tr>
<td><a href="#PDFRender.flushSegment">flushSegment</a></td>
<td>Public method to flush a segment of data.</td>
</tr><tr>
<td><a href="#PDFRender.fontToPoints">fontToPoints</a></td>
<td>Public method to convert the font size to points.</td>
</tr><tr>
<td><a href="#PDFRender.nextLine">nextLine</a></td>
<td>Public method to start a new line.</td>
</tr><tr>
<td><a href="#PDFRender.setStyle">setStyle</a></td>
<td>Public method to set a style.</td>
</tr><tr>
<td><a href="#PDFRender.startPDF">startPDF</a></td>
<td>Public method to start the PDF document.</td>
</tr><tr>
<td><a href="#PDFRender.startPage">startPage</a></td>
<td>Public method to start a new page.</td>
</tr>
</table>
<h3>Static Methods</h3>
<table>
<tr><td>None</td></tr>
</table>
<a NAME="PDFRender.__init__" ID="PDFRender.__init__"></a>
<h4>PDFRender (Constructor)</h4>
<b>PDFRender</b>(<i></i>)
<p>
        Constructor
</p><a NAME="PDFRender.add" ID="PDFRender.add"></a>
<h4>PDFRender.add</h4>
<b>add</b>(<i>ch, style_</i>)
<p>
        Public method to add a character to the page.
</p><dl>
<dt><i>ch</i></dt>
<dd>
character to add (string)
</dd><dt><i>style_</i></dt>
<dd>
number of the style of the character (integer)
</dd>
</dl><a NAME="PDFRender.endPDF" ID="PDFRender.endPDF"></a>
<h4>PDFRender.endPDF</h4>
<b>endPDF</b>(<i></i>)
<p>
        Public method to end the PDF document.
</p><a NAME="PDFRender.endPage" ID="PDFRender.endPage"></a>
<h4>PDFRender.endPage</h4>
<b>endPage</b>(<i></i>)
<p>
        Public method to end a page.
</p><a NAME="PDFRender.flushSegment" ID="PDFRender.flushSegment"></a>
<h4>PDFRender.flushSegment</h4>
<b>flushSegment</b>(<i></i>)
<p>
        Public method to flush a segment of data.
</p><a NAME="PDFRender.fontToPoints" ID="PDFRender.fontToPoints"></a>
<h4>PDFRender.fontToPoints</h4>
<b>fontToPoints</b>(<i>thousandths</i>)
<p>
        Public method to convert the font size to points.
</p><dl>
<dt>Returns:</dt>
<dd>
point size of the font (integer)
</dd>
</dl><a NAME="PDFRender.nextLine" ID="PDFRender.nextLine"></a>
<h4>PDFRender.nextLine</h4>
<b>nextLine</b>(<i></i>)
<p>
        Public method to start a new line.
</p><a NAME="PDFRender.setStyle" ID="PDFRender.setStyle"></a>
<h4>PDFRender.setStyle</h4>
<b>setStyle</b>(<i>style_</i>)
<p>
        Public method to set a style.
</p><dl>
<dt><i>style_</i></dt>
<dd>
style to be set (integer)
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
the PDF string to set the given style (string)
</dd>
</dl><a NAME="PDFRender.startPDF" ID="PDFRender.startPDF"></a>
<h4>PDFRender.startPDF</h4>
<b>startPDF</b>(<i></i>)
<p>
        Public method to start the PDF document.
</p><a NAME="PDFRender.startPage" ID="PDFRender.startPage"></a>
<h4>PDFRender.startPage</h4>
<b>startPage</b>(<i></i>)
<p>
        Public method to start a new page.
</p>
<div align="right"><a href="#top">Up</a></div>
<hr /><hr />
<a NAME="PDFStyle" ID="PDFStyle"></a>
<h2>PDFStyle</h2>
<p>
    Simple class to store the values of a PDF style.
</p>
<h3>Derived from</h3>
object
<h3>Class Attributes</h3>
<table>
<tr><td>None</td></tr>
</table>
<h3>Class Methods</h3>
<table>
<tr><td>None</td></tr>
</table>
<h3>Methods</h3>
<table>
<tr>
<td><a href="#PDFStyle.__init__">PDFStyle</a></td>
<td>Constructor</td>
</tr>
</table>
<h3>Static Methods</h3>
<table>
<tr><td>None</td></tr>
</table>
<a NAME="PDFStyle.__init__" ID="PDFStyle.__init__"></a>
<h4>PDFStyle (Constructor)</h4>
<b>PDFStyle</b>(<i></i>)
<p>
        Constructor
</p>
<div align="right"><a href="#top">Up</a></div>
<hr />
</body></html>