wxHtmlEasyPrinting — wx v2.4.2

Search documentation of wx

# View Source wxHtmlEasyPrinting (wx v2.4.2)

Functions for wxHtmlEasyPrinting class

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.

wxWidgets docs: wxHtmlEasyPrinting

# Summary

## Types

wxHtmlEasyPrinting()

## Functions

destroy(This)

Destroys the object.

getPageSetupData(This)

Returns a pointer to `wxPageSetupDialogData` instance used by this class.

getPrintData(This)

Returns pointer to `wxPrintData` instance used by this class.

new()
new(Options)

Constructor.

pageSetup(This)

Display page setup dialog and allows the user to modify settings.

previewFile(This, Htmlfile)

Preview HTML file.

previewText(This, Htmltext)
previewText/3

Preview HTML text (not file!).

printFile(This, Htmlfile)

Print HTML file.

printText(This, Htmltext)
printText/3

Print HTML text (not file!).

setFonts(This, Normal_face, Fixed_face)
setFonts/4

Sets fonts.

setFooter(This, Footer)
setFooter/3

Set page footer.

setHeader(This, Header)
setHeader/3

Set page header.

# Types

Link to this type

# wxHtmlEasyPrinting()

View Source

    -type wxHtmlEasyPrinting() :: wx:wx_object().

# Functions

Link to this function

# destroy(This)

View Source

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

Destroys the object.

Link to this function

# getPageSetupData(This)

View Source

    -spec getPageSetupData(This) -> wxPageSetupDialogData:wxPageSetupDialogData()
                              when This :: wxHtmlEasyPrinting().

Returns a pointer to `wxPageSetupDialogData` instance used by this class.

You can set its parameters (via SetXXXX methods).

Link to this function

# getPrintData(This)

View Source

    -spec getPrintData(This) -> wxPrintData:wxPrintData() when This :: wxHtmlEasyPrinting().

Returns pointer to `wxPrintData` instance used by this class.

You can set its parameters (via SetXXXX methods).

Link to this function

# new()

View Source

    -spec new() -> wxHtmlEasyPrinting().

Link to this function

# new(Options)

View Source

    -spec new([Option]) -> wxHtmlEasyPrinting()
                 when Option :: {name, unicode:chardata()} | {parentWindow, wxWindow:wxWindow()}.

Constructor.

Link to this function

# pageSetup(This)

View Source

    -spec pageSetup(This) -> ok when This :: wxHtmlEasyPrinting().

Display page setup dialog and allows the user to modify settings.

Link to this function

# previewFile(This, Htmlfile)

View Source

    -spec 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.

Link to this function

# previewText(This, Htmltext)

View Source

    -spec previewText(This, Htmltext) -> boolean()
                         when This :: wxHtmlEasyPrinting(), Htmltext :: unicode:chardata().

Link to this function

# previewText/3

View Source

    -spec previewText(This, Htmltext, [Option]) -> boolean()
                         when
                             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.

Link to this function

# printFile(This, Htmlfile)

View Source

    -spec printFile(This, Htmlfile) -> boolean()
                       when This :: wxHtmlEasyPrinting(), Htmlfile :: unicode:chardata().

Print HTML file.

Returns false in case of error - call `wxPrinter:getLastError/0` to get detailed information about the kind of the error.

Link to this function

# printText(This, Htmltext)

View Source

    -spec printText(This, Htmltext) -> boolean()
                       when This :: wxHtmlEasyPrinting(), Htmltext :: unicode:chardata().

Link to this function

# printText/3

View Source

    -spec printText(This, Htmltext, [Option]) -> boolean()
                       when
                           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.

Link to this function

# setFonts(This, Normal_face, Fixed_face)

View Source

    -spec setFonts(This, Normal_face, Fixed_face) -> ok
                      when
                          This :: wxHtmlEasyPrinting(),
                          Normal_face :: unicode:chardata(),
                          Fixed_face :: unicode:chardata().

Link to this function

# setFonts/4

View Source

    -spec setFonts(This, Normal_face, Fixed_face, [Option]) -> ok
                      when
                          This :: wxHtmlEasyPrinting(),
                          Normal_face :: unicode:chardata(),
                          Fixed_face :: unicode:chardata(),
                          Option :: {sizes, [integer()]}.

Sets fonts.

See `wxHtmlDCRenderer::SetFonts` (not implemented in wx) for detailed description.

Link to this function

# setFooter(This, Footer)

View Source

    -spec setFooter(This, Footer) -> ok when This :: wxHtmlEasyPrinting(), Footer :: unicode:chardata().

Link to this function

# setFooter/3

View Source

    -spec 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

Link to this function

# setHeader(This, Header)

View Source

    -spec setHeader(This, Header) -> ok when This :: wxHtmlEasyPrinting(), Header :: unicode:chardata().

Link to this function

# setHeader/3

View Source

    -spec 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: