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
|
.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2020 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. _wx.html.HtmlPrintout:
==========================================================================================================================================
|phoenix_title| **wx.html.HtmlPrintout**
==========================================================================================================================================
This class serves as printout class for HTML documents.
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html
<div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
<img id="toggleBlock-trigger" src="_static/images/closed.png"/>
Inheritance diagram for class <strong>HtmlPrintout</strong>:
</div>
<div id="toggleBlock-summary" style="display:block;"></div>
<div id="toggleBlock-content" style="display:none;">
<p class="graphviz">
<center><img src="_static/images/inheritance/wx.html.HtmlPrintout_inheritance.png" alt="Inheritance diagram of HtmlPrintout" usemap="#dummy" class="inheritance"/></center>
<script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
<map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.html.HtmlPrintout.html" title="wx.html.HtmlPrintout" alt="" coords="5,160,168,189"/> <area shape="rect" id="node2" href="wx.Printout.html" title="wx.Printout" alt="" coords="39,83,135,112"/> <area shape="rect" id="node3" href="wx.Object.html" title="wx.Object" alt="" coords="43,5,130,35"/> </map>
</p>
</div>
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.html.HtmlPrintout.__init__` Constructor.
:meth:`~wx.html.HtmlPrintout.AddFilter` Adds a filter to the static list of filters for :ref:`wx.html.HtmlPrintout`.
:meth:`~wx.html.HtmlPrintout.SetFonts` This function sets font sizes and faces.
:meth:`~wx.html.HtmlPrintout.SetFooter` Set page footer.
:meth:`~wx.html.HtmlPrintout.SetHeader` Set page header.
:meth:`~wx.html.HtmlPrintout.SetHtmlFile` Prepare the class for printing this HTML **file**.
:meth:`~wx.html.HtmlPrintout.SetHtmlText` Prepare the class for printing this HTML text.
:meth:`~wx.html.HtmlPrintout.SetMargins` Sets margins in millimeters.
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: wx.html.HtmlPrintout(Printout)
**Possible constructors**::
HtmlPrintout(title="Printout")
This class serves as printout class for HTML documents.
.. method:: __init__(self, title="Printout")
Constructor.
:param `title`:
:type `title`: string
.. staticmethod:: AddFilter(filter)
Adds a filter to the static list of filters for :ref:`wx.html.HtmlPrintout`.
See :ref:`wx.html.HtmlFilter` for further information.
:param `filter`:
:type `filter`: wx.html.HtmlFilter
.. method:: SetFonts(self, normal_face, fixed_face, sizes)
This function sets font sizes and faces.
See :meth:`wx.html.HtmlWindow.SetFonts` for detailed description.
:param `normal_face`:
:type `normal_face`: string
:param `fixed_face`:
:type `fixed_face`: string
:param `sizes`:
:type `sizes`: list of integers
.. method:: SetFooter(self, footer, pg=PAGE_ALL)
Set page footer.
The following macros can be used inside it:
- @``DATE``@ is replaced by the current date in default format
- @``PAGENUM``@ is replaced by page number
- @``PAGESCNT``@ is replaced by total number of pages
- @``TIME``@ is replaced by the current time in default format
- @``TITLE``@ is replaced with the title of the document
:param `footer`: HTML text to be used as footer.
:type `footer`: string
:param `pg`: one of ``wx.html.PAGE_ODD``, ``wx.html.PAGE_EVEN`` and ``wx.html.PAGE_ALL`` constants.
:type `pg`: int
.. method:: SetHeader(self, header, pg=PAGE_ALL)
Set page header.
The following macros can be used inside it:
- @``DATE``@ is replaced by the current date in default format
- @``PAGENUM``@ is replaced by page number
- @``PAGESCNT``@ is replaced by total number of pages
- @``TIME``@ is replaced by the current time in default format
- @``TITLE``@ is replaced with the title of the document
:param `header`: HTML text to be used as header.
:type `header`: string
:param `pg`: one of ``wx.html.PAGE_ODD``, ``wx.html.PAGE_EVEN`` and ``wx.html.PAGE_ALL`` constants.
:type `pg`: int
.. method:: SetHtmlFile(self, htmlfile)
Prepare the class for printing this HTML **file**.
The file may be located on any virtual file system or it may be normal file.
:param `htmlfile`:
:type `htmlfile`: string
.. method:: SetHtmlText(self, html, basepath=EmptyString, isdir=True)
Prepare the class for printing this HTML text.
:param `html`: HTML text. (NOT file!)
:type `html`: string
:param `basepath`: base directory (html string would be stored there if it was in file). It is used to determine path for loading images, for example.
:type `basepath`: string
:param `isdir`: ``False`` if basepath is filename, ``True`` if it is directory name (see :ref:`wx.FileSystem` for detailed explanation).
:type `isdir`: bool
.. method:: SetMargins(self, *args, **kw)
|overload| Overloaded Implementations:
:html:`<hr class="overloadsep" /><br />`
**SetMargins** `(self, top=25.2, bottom=25.2, left=25.2, right=25.2, spaces=5)`
Sets margins in millimeters.
Defaults to 1 inch for margins and 0.5cm for space between text and header and/or footer.
:param `top`:
:type `top`: float
:param `bottom`:
:type `bottom`: float
:param `left`:
:type `left`: float
:param `right`:
:type `right`: float
:param `spaces`:
:type `spaces`: float
:html:`<hr class="overloadsep" /><br />`
**SetMargins** `(self, pageSetupData)`
Sets margins from :ref:`wx.PageSetupDialogData`.
:param `pageSetupData`:
:type `pageSetupData`: wx.PageSetupDialogData
.. versionadded:: 4.1/wxWidgets-3.1.0
:html:`<hr class="overloadsep" /><br />`
|