wxHtmlEasyPrinting(3erl)

πŸ’… wxHtmlEasyPrinting (3erl) πŸ’…

From the Erlang Module Definition shelf, bestie β€” this is the manual page for wxHtmlEasyPrinting, and she's lowkey iconic. πŸŽ€


🌸 NAME 🌸

wxHtmlEasyPrinting β€” functions for the wxHtmlEasyPrinting class. That's the whole name vibe, periodt. πŸ’–


✨ DESCRIPTION ✨

This class is a very simple interface to the printing architecture. It lets you print HTML documents using only a few commands β€” it's giving "small API, big main character energy." πŸ–¨οΈβœ¨

⚠️ Do NOT create this class on the stack only. You should create an instance on app startup and use that instance for all printing operations. The reason? This class stores various settings inside it. So like, she needs to stick around. πŸ’…

The wxWidgets docs page is literally called wxHtmlEasyPrinting β€” iykyk. πŸ¦‹


🧚 DATA TYPES 🧚

wxHtmlEasyPrinting() = wx:wx_object()

That's it. That's the data type. No cap. πŸ’œ


πŸ”₯ EXPORTS πŸ”₯

Okay bestie, here's every single export β€” no skipping, no summarizing, no "oops I forgot an option." We don't do that here. 🌈

πŸ’– new()

new() -> wxHtmlEasyPrinting()
new(Options :: [Option]) -> wxHtmlEasyPrinting()

Types:

  • Option = {name, unicode:chardata()} | {parentWindow, wxWindow:wxWindow()}

Constructor. Classic. πŸŽ€


🫢 getPrintData(This)

getPrintData(This) -> wxPrintData:wxPrintData()

Types:

  • This = wxHtmlEasyPrinting()

Returns a pointer to the wxPrintData instance used by this class. You can set its parameters via the SetXXXX methods β€” yes, literally SetXXXX, that's the source's vibe. πŸ’€


πŸ¦‹ getPageSetupData(This)

getPageSetupData(This) ->
                    wxPageSetupDialogData:wxPageSetupDialogData()

Types:

  • This = wxHtmlEasyPrinting()

Returns a pointer to the wxPageSetupDialogData instance used by this class. You can set its parameters via the SetXXXX methods. Same energy as above. ✨


🌸 previewFile(This, Htmlfile)

previewFile(This, Htmlfile) -> boolean()

Types:

  • This = wxHtmlEasyPrinting()
  • Htmlfile = unicode:chardata()

Preview an 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 fails, don't just vibe, go check the error. 😭


πŸŽ€ previewText(This, Htmltext)

previewText(This, Htmltext) -> boolean()
previewText(This, Htmltext, Options :: [Option]) -> boolean()

Types:

  • This = wxHtmlEasyPrinting()
  • Htmltext = unicode:chardata()
  • Option = {basepath, unicode:chardata()}

Preview HTML text (not file!). Returns false in case of error β€” call wxPrinter:getLastError/0 to get detailed information about the kind of the error. Not me emphasizing not file! again, but the source literally says it. πŸ™ˆ


πŸ’œ printFile(This, Htmlfile)

printFile(This, Htmlfile) -> boolean()

Types:

  • This = wxHtmlEasyPrinting()
  • Htmlfile = unicode:chardata()

Print an HTML file. Returns false in case of error β€” call wxPrinter:getLastError/0 to get detailed information about the kind of the error. πŸ’…


🌈 printText(This, Htmltext)

printText(This, Htmltext) -> boolean()
printText(This, Htmltext, Options :: [Option]) -> boolean()

Types:

  • This = wxHtmlEasyPrinting()
  • Htmltext = unicode:chardata()
  • Option = {basepath, unicode:chardata()}

Print HTML text (not file!). Returns false in case of error β€” call wxPrinter:getLastError/0 to get detailed information about the kind of the error. πŸ–¨οΈ


✨ pageSetup(This)

pageSetup(This) -> ok

Types:

  • This = wxHtmlEasyPrinting()

Displays the page setup dialog and allows the user to modify settings. Very "let the user cook" energy. πŸ‘‘


πŸŽ€ setFonts(This, Normal_face, Fixed_face)

setFonts(This, Normal_face, Fixed_face) -> ok
setFonts(This, Normal_face, Fixed_face, Options :: [Option]) -> ok

Types:

  • This = wxHtmlEasyPrinting()
  • Normal_face = Fixed_face = unicode:chardata()
  • Option = {sizes, [integer()]}

Sets fonts. See wxHtmlDCRenderer::SetFonts (not implemented in wx) for detailed description β€” yes, that parenthetical is exactly the source tea. 🫢


πŸ’– setHeader(This, Header)

setHeader(This, Header) -> ok
setHeader(This, Header, Options :: [Option]) -> ok

Types:

  • This = wxHtmlEasyPrinting()
  • Header = unicode:chardata()
  • Option = {pg, integer()}

Set page header.

The following macros can be used inside it: (the source page doesn't list them here under setHeader β€” not me inventing anything, bestie πŸ™ˆ)


setFooter(This, Footer) -> ok
setFooter(This, Footer, Options :: [Option]) -> ok

Types:

  • This = wxHtmlEasyPrinting()
  • Footer = unicode:chardata()
  • Option = {pg, integer()}

Set page footer.

The following macros can be used inside it:

  • @DATE@ β€” replaced by the current date in default format
  • @PAGENUM@ β€” replaced by page number
  • @PAGESCNT@ β€” replaced by total number of pages
  • @TIME@ β€” replaced by the current time in default format
  • @TITLE@ β€” replaced with the title of the document

Obsessed with a macro list that actually tells you what's up. πŸ’…


πŸ’€ destroy(This :: wxHtmlEasyPrinting())

destroy(This :: wxHtmlEasyPrinting()) -> ok

Destroys the object. Cleanup era. Bye bestie. 🫢


okay that's the whole page, bestie. πŸ’– Made by the wxWidgets team β€” source/version wx 2.2.2.1, page wxHtmlEasyPrinting(3erl). The footer didn't have a date, so we're not making one up. πŸŽ€βœ¨

πŸ“¦ where this page comes from