Documentation/Source/eric5.QScintilla.Exporters.ExporterPDF.html

Sun, 22 Apr 2012 12:03:49 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 22 Apr 2012 12:03:49 +0200
branch
5_2_x
changeset 1809
b51de83c643a
parent 1229
a8207dc73672
child 2367
78f6c8193d37
permissions
-rw-r--r--

Updated source docu.

<?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>eric5.QScintilla.Exporters.ExporterPDF</title>
<style>
body {
    background: #EDECE6;
    margin: 0em 1em 10em 1em;
    color: black;
}

h1 { color: white; background: #85774A; }
h2 { color: white; background: #85774A; }
h3 { color: white; background: #9D936E; }
h4 { color: white; background: #9D936E; }
    
a { color: #BA6D36; }

</style>
</head>
<body><a NAME="top" ID="top"></a>
<h1>eric5.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>

eric ide

mercurial