This class provides very simple interface to printing architecture.
It allows you to print HTML documents using only a few commands.
Note
Do not create this class on the stack only. You should create an instance on app startup and use this instance for all printing operations. The reason is that this class stores various settings in it.
Class Hierarchy¶Inheritance diagram for class
HtmlEasyPrinting:
Methods Summary¶ Properties Summary¶ Class API¶Possible constructors:
HtmlEasyPrinting(name="Printing", parentWindow=None) -> None
This class provides very simple interface to printing architecture.
Constructor.
name (string) â Name of the printing object. Used by preview frames and setup dialogs.
parentWindow (wx.Window) â pointer to the window that will own the preview frame and setup dialogs. May be None
.
None
Returns the current name being used for preview frames and setup dialogs.
str
Added in version 2.8.11: / 2.9.1
Returns a pointer to wx.PageSetupDialogData instance used by this class.
You can set its parameters (via SetXXXX methods).
PageSetupDialogData
Gets the parent window for dialogs.
Window
Returns pointer to wx.PrintData instance used by this class.
You can set its parameters (via SetXXXX methods).
Display page setup dialog and allows the user to modify settings.
None
Preview HTML file.
Returns False
in case of error â call wx.Printer.GetLastError
to get detailed information about the kind of the error.
htmlfile (string)
bool
Preview HTML text (not file!).
Returns False
in case of error â call wx.Printer.GetLastError
to get detailed information about the kind of the error.
htmltext (string) â HTML text.
basepath (string) â base directory (html string would be stored there if it was in file). It is used to determine path for loading images, for example.
bool
Print HTML file.
Returns False
in case of error â call wx.Printer.GetLastError
to get detailed information about the kind of the error.
htmlfile (string)
bool
Print HTML text (not file!).
Returns False
in case of error â call wx.Printer.GetLastError
to get detailed information about the kind of the error.
htmltext (string) â HTML text.
basepath (string) â base directory (html string would be stored there if it was in file). It is used to determine path for loading images, for example.
bool
Sets fonts.
See wx.html.HtmlDCRenderer.SetFonts
for detailed description.
normal_face (string)
fixed_face (string)
sizes (list of integers)
None
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
footer (string) â HTML text to be used as footer.
pg (int) â one of wx.html.PAGE_ODD
, wx.html.PAGE_EVEN
and wx.html.PAGE_ALL
constants.
None
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
header (string) â HTML text to be used as header.
pg (int) â one of wx.html.PAGE_ODD
, wx.html.PAGE_EVEN
and wx.html.PAGE_ALL
constants.
None
Sets the name used for preview frames and setup dialogs.
name (string)
None
Added in version 2.8.11: / 2.9.1
Sets the parent window for dialogs.
window (wx.Window)
None
Enable or disable showing the dialog before printing.
The prompt mode determines the value of the prompt
parameter passed to wx.Printer.Print
when it is called by this class.
Default prompt mode value is Prompt_Always.
promptMode (PromptMode)
None
Added in version 4.1/wxWidgets-3.1.2.
Sets default font sizes and/or default font size.
See wx.html.HtmlDCRenderer.SetStandardFonts
for detailed description.
size (int)
normal_face (string)
fixed_face (string)
None
See GetPageSetupData
See GetParentWindow
and SetParentWindow
See GetPrintData
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4