2 % automatically generated by HelpGen from
3 % htmprint.h at 17/Oct/99 12:48:02
6 \section{\class{wxHtmlDCRenderer
}}\label{wxhtmldcrenderer
}
8 This class can render HTML
document into a specified area of a DC. You can use it
9 in your own printing code, although use of
\helpref{wxHtmlEasyPrinting
}{wxhtmleasyprinting
}
10 or
\helpref{wxHtmlPrintout
}{wxhtmlprintout
} is strongly recommended.
12 \wxheading{Derived from
}
14 \helpref{wxObject
}{wxobject
}
16 \wxheading{Include files
}
20 \latexignore{\rtfignore{\wxheading{Members
}}}
22 \membersection{wxHtmlDCRenderer::wxHtmlDCRenderer
}\label{wxhtmldcrendererwxhtmldcrenderer
}
24 \func{}{wxHtmlDCRenderer
}{\void}
28 \membersection{wxHtmlDCRenderer::SetDC
}\label{wxhtmldcrenderersetdc
}
30 \func{void
}{SetDC
}{\param{wxDC*
}{dc
},
\param{double
}{pixel
\_scale =
1.0}}
32 Assign DC instance to the renderer.
34 {\it pixel
\_scale} can be used when rendering to high-resolution DCs (e.g. printer) to adjust size of pixel metrics.
35 (Many dimensions in HTML are given in pixels -- e.g. image sizes.
300x300 image would be only one
36 inch wide on typical printer. With pixel
\_scale =
3.0 it would be
3 inches.)
38 \wxheading{Parameters
}
40 \docparam{maxwidth
}{width of the area (on this DC) that is equivalent to the screen's width,
41 in pixels (you should set it to page width minus margins).
43 {\bf Note:
} In the current implementation
44 the screen width is always
800 pixels: it gives best results and ensures (almost) same printed outputs
45 across platforms and differently configured desktops.
}
47 \membersection{wxHtmlDCRenderer::SetFonts
}\label{wxhtmldcrenderersetfonts
}
49 \func{void
}{SetFonts
}{\param{wxString
}{normal
\_face},
\param{wxString
}{fixed
\_face},
\param{const int
}{*sizes = NULL
}}
51 Sets fonts. See
\helpref{wxHtmlWindow::SetFonts
}{wxhtmlwindowsetfonts
} for
54 See also
\helpref{SetSize
}{wxhtmldcrenderersetsize
}.
56 \membersection{wxHtmlDCRenderer::SetSize
}\label{wxhtmldcrenderersetsize
}
58 \func{void
}{SetSize
}{\param{int
}{width
},
\param{int
}{height
}}
60 Set size of output rectangle, in pixels. Note that you
{\bf can't
} change
61 width of the rectangle between calls to
\helpref{Render
}{wxhtmldcrendererrender
}!
62 (You can freely change height.)
64 \membersection{wxHtmlDCRenderer::SetHtmlText
}\label{wxhtmldcrenderersethtmltext
}
66 \func{void
}{SetHtmlText
}{\param{const wxString\&
}{html
},
\param{const wxString\&
}{basepath = wxEmptyString
},
\param{bool
}{isdir = true
}}
68 Assign text to the renderer.
\helpref{Render
}{wxhtmldcrendererrender
} then draws
71 \wxheading{Parameters
}
73 \docparam{html
}{HTML text. This is
{\it not
} a filename.
}
75 \docparam{basepath
}{base directory (html string would be stored there if it was in
76 file). It is used to determine path for loading images, for example.
}
78 \docparam{isdir
}{false if basepath is filename, true if it is directory name
79 (see
\helpref{wxFileSystem
}{wxfilesystem
} for detailed explanation)
}
81 \membersection{wxHtmlDCRenderer::Render
}\label{wxhtmldcrendererrender
}
83 \func{int
}{Render
}{\param{int
}{x
},
\param{int
}{y
},
\param{int
}{from =
0},
\param{int
}{dont
\_render = false
}}
85 Renders HTML text to the DC.
87 \wxheading{Parameters
}
89 \docparam{x,y
}{ position of upper-left corner of printing rectangle (see
\helpref{SetSize
}{wxhtmldcrenderersetsize
})
}
91 \docparam{from
}{y-coordinate of the very first visible cell
}
93 \docparam{dont
\_render}{if true then this method only returns y coordinate of the next page
94 and does not output anything
}
96 Returned value is y coordinate of first cell than didn't fit onto page.
97 Use this value as
{\it from
} in next call to Render in order to print multipages
102 The Following three methods
{\bf must
} always be called before any call to Render (preferably
105 \begin{itemize
}\itemsep=
0pt
106 \item \helpref{SetDC
}{wxhtmldcrenderersetdc
}
107 \item \helpref{SetSize
}{wxhtmldcrenderersetsize
}
108 \item \helpref{SetHtmlText
}{wxhtmldcrenderersethtmltext
}
111 {\bf Render() changes the DC's user scale and does NOT restore it.
}
113 \membersection{wxHtmlDCRenderer::GetTotalHeight
}\label{wxhtmldcrenderergettotalheight
}
115 \func{int
}{GetTotalHeight
}{\void}
117 Returns the height of the HTML text. This is important if area height (see
\helpref{SetSize
}{wxhtmldcrenderersetsize
})
118 is smaller that total height and thus the page cannot fit into it. In that case you're supposed to
119 call
\helpref{Render
}{wxhtmldcrendererrender
} as long as its return value is smaller than GetTotalHeight's.