wxhtmldcrendererthis class can render html document into a specified area of a dc. you can use it in your own printing code, although use of wxhtmleasyprinting or wxhtmlprintout is strongly recommended. derived from include files <wx/html/htmprint.h> members
wxhtmldcrenderer::wxhtmldcrenderer
wxhtmldcrenderer::wxhtmldcrendererwxhtmldcrenderer() constructor.
wxhtmldcrenderer::setdcvoid setdc(wxdc* dc, double pixel_scale = 1.0) assign dc instance to the renderer. pixel_scale can be used when rendering to high-resolution dcs (e.g. printer) to adjust size of pixel metrics. (many dimensions in html are given in pixels -- e.g. image sizes. 300x300 image would be only one inch wide on typical printer. with pixel_scale = 3.0 it would be 3 inches.)
wxhtmldcrenderer::setfontsvoid setfonts(const wxstring& normal_face, const wxstring& fixed_face, const int *sizes = null) sets fonts. see wxhtmlwindow::setfonts for detailed description. see also setsize.
wxhtmldcrenderer::setsizevoid setsize(int width, int height) set size of output rectangle, in pixels. note that you can't change width of the rectangle between calls to render! (you can freely change height.)
wxhtmldcrenderer::sethtmltextvoid sethtmltext(const wxstring& html, const wxstring& basepath = wxemptystring, bool isdir = true) assign text to the renderer. render then draws the text onto dc. parameters html
basepath
isdir
wxhtmldcrenderer::renderint render(int x, int y, int from = 0, int dont_render = false) renders html text to the dc. parameters x,y
from
dont_render
returned value is y coordinate of first cell than didn't fit onto page. use this value as from in next call to render in order to print multipages document. caution! the following three methods must always be called before any call to render (preferably in this order):
render() changes the dc's user scale and does not restore it.
wxhtmldcrenderer::gettotalheightint gettotalheight() returns the height of the html text. this is important if area height (see setsize) is smaller that total height and thus the page cannot fit into it. in that case you're supposed to call render as long as its return value is smaller than gettotalheight's.
|