wxHtmlEasyPrinting(3)
π wxHtmlEasyPrinting β the Erlang module, bestie edition π
okay so welcome to wxHtmlEasyPrinting(3), the Erlang module definition that lives in the wx world β¨ (yes it ships with wx 2.6, we'll get to that at the end, stay with me).
πΈ NAME πΈ
wxHtmlEasyPrinting β this class provides a very simple interface to the printing architecture. that's it, that's the whole vibe. printing but make it easy π¨οΈπ
β¨ DESCRIPTION β¨
It lets you print HTML documents using only a few commands. likeβ¦ a few. not a whole config saga. we love that for us π«Ά
β οΈ Note, and this one is serious bestie: 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. so if you make it a lil temporary stack gremlin and then it vanishes, your settings vanish with it π keep it alive, keep it on the main character pedestal it deserves. π
wxWidgets docs: wxHtmlEasyPrinting (that's where the real tea is, iykyk π)
π¦ DATA TYPES π¦
wxHtmlEasyPrinting() :: wx:wx_object().
that's the type. one line. iconic. periodt. β¨
π FUNCTIONS π
destroy/1 β say bye bye π
destroy(This :: wxHtmlEasyPrinting()) -> ok.
Destroys the object. that's the whole thing. it's gone, it's over, it left the group chat π
getPageSetupData/1 β the page setup receipts π
getPageSetupData(This) ->
wxPageSetupDialogData:wxPageSetupDialogData()
when This :: wxHtmlEasyPrinting().
Returns a pointer to the wxPageSetupDialogData instance used by this class.
You can set its parameters (via SetXXXX methods). yep, the good old SetXXXX family, no we don't list them, that's not this manpage's job π
getPrintData/1 β the print data receipts π¨οΈ
getPrintData(This) -> wxPrintData:wxPrintData()
when This :: wxHtmlEasyPrinting().
Returns pointer to the wxPrintData instance used by this class.
You can set its parameters (via SetXXXX methods). same deal, same energy β¨
new/1 β the birth of an icon π
new([Option]) -> wxHtmlEasyPrinting()
when
Option ::
{name, unicode:chardata()} |
{parentWindow, wxWindow:wxWindow()}.
Constructor. that's how you make one. and remember β app startup, one instance, keep it around, don't stack-only it, i'm watching you π
pageSetup/1 β open the little dialog π
pageSetup(This) -> ok when This :: wxHtmlEasyPrinting().
Display page setup dialog and allows the user to modify settings. so your user gets to tweak stuff themselves, adorable, love that for them π«Ά
previewFile/2 β sneak peek, but a file π
previewFile(This, Htmlfile) -> boolean()
when
This :: wxHtmlEasyPrinting(),
Htmlfile :: unicode:chardata().
Preview HTML file.
Returns false in case of error β call wxPrinter:getLastError/0 to get detailed information about the kind of the error. so if it flops, go ask wxPrinter:getLastError/0 what happened, it'll spill the tea π΅
previewText/3 β sneak peek, but text π
previewText(This, Htmltext, [Option]) -> boolean()
when
This :: wxHtmlEasyPrinting(),
Htmltext :: unicode:chardata(),
Option :: {basepath, unicode:chardata()}.
Preview HTML text (not file! β read that again bestie, text, not a file, they're different and the manpage is yelling about it π).
Returns false in case of error β call wxPrinter:getLastError/0 to get detailed information about the kind of the error. same drill, same savior function π
printFile/2 β actually printing, a file edition π¨οΈβ¨
printFile(This, Htmlfile) -> boolean()
when
This :: wxHtmlEasyPrinting(),
Htmlfile :: unicode:chardata().
Print HTML file. real paper. real ink. (or a PDF, we don't judge π )
Returns false in case of error β call wxPrinter:getLastError/0 to get detailed information about the kind of the error.
printText/3 β actually printing, a text edition π¨οΈπ
printText(This, Htmltext, [Option]) -> boolean()
when
This :: wxHtmlEasyPrinting(),
Htmltext :: unicode:chardata(),
Option :: {basepath, unicode:chardata()}.
Print HTML text (not file! π again, text, not file).
Returns false in case of error β call wxPrinter:getLastError/0 to get detailed information about the kind of the error.
setFonts/4 β glow-up time for your glyphs π
setFonts(This, Normal_face, Fixed_face, [Option]) -> ok
when
This :: wxHtmlEasyPrinting(),
Normal_face :: unicode:chardata(),
Fixed_face :: unicode:chardata(),
Option :: {sizes, [integer()]}.
Sets fonts. yes you get a Normal_face, a Fixed_face, and optionally some sizes. define your aesthetic π
See wxHtmlDCRenderer::SetFonts (not implemented in wx) for detailed description. β note that: not implemented in wx. so if you go looking for it over there, it's not there, that's not a typo, that's just how it is π
setFooter/3 β bottom of the page, but make it cute π
setFooter(This, Footer, [Option]) -> ok
when
This :: wxHtmlEasyPrinting(),
Footer :: unicode:chardata(),
Option :: {pg, integer()}.
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
(all crammed into one run-on sentence in the original, but bestie i broke it out for you because you deserve a readable list π)
setHeader/3 β top of the page, also cute πΈ
setHeader(This, Header, [Option]) -> ok
when
This :: wxHtmlEasyPrinting(),
Header :: unicode:chardata(),
Option :: {pg, integer()}.
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
same five macros as the footer, no cap. @PAGENUM@, @PAGESCNT@, @DATE@, @TIME@, @TITLE@ β that's the squad π
π SEE ALSOβ¦ nope, there isn't one π
okay and that's genuinely the entire page, there's no SEE ALSO section in this one, no env vars, no exit statuses, nothing hiding under the couch ποΈβ¨
and that's the whole thing bestie, we did it, printing architecture but make it easy, π you're literally a printer whisperer now π
β¨ before you go β this lil doc came to you from Ericsson AB, riding with wx 2.6, and yes its name is, iconically, wxHtmlEasyPrinting(3). mwah. π«Άππ
π¦ where this page comes from
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms