wxHtmlEasyPrinting(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

πŸ’– 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