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 \latexignore{\rtfignore{\wxheading{Members
}}}
18 \membersection{wxHtmlDCRenderer::wxHtmlDCRenderer
}\label{wxhtmldcrendererwxhtmldcrenderer
}
20 \func{}{wxHtmlDCRenderer
}{\void}
24 \membersection{wxHtmlDCRenderer::SetDC
}\label{wxhtmldcrenderersetdc
}
26 \func{void
}{SetDC
}{\param{wxDC*
}{dc
},
\param{double
}{pixel_scale =
1.0}}
28 Assign DC instance to the renderer.
30 {\it pixel_scale
} can be used when rendering to high-resolution DCs (e.g. printer) to adjust size of pixel metrics.
31 (Many dimensions in HTML are given in pixels - e.g. image sizes.
300x300 image would be only one
32 inch wide on typical printer. With pixel_scale =
3.0 it would be
3 inches.)
34 \wxheading{Parameters
}
36 \docparam{maxwidth
}{width of the area (on this DC) that is equivalent to screen's width,
37 in pixels (you should set it to page width minus margins).
39 {\bf Note:
} In the current implementation
40 the screen width is always
800 pixels: it gives best results and ensures (almost) same printed outputs
41 across platforms and differently configured desktops.
}
43 See also
\helpref{SetSize
}{wxhtmldcrenderersetsize
}.
45 \membersection{wxHtmlDCRenderer::SetSize
}\label{wxhtmldcrenderersetsize
}
47 \func{void
}{SetSize
}{\param{int
}{width
},
\param{int
}{height
}}
49 Set size of output rectangle, in pixels. Note that you
{\bf can't
} change
50 width of the rectangle between calls to
\helpref{Render
}{wxhtmldcrendererrender
}!
51 (You can freely change height.)
53 \membersection{wxHtmlDCRenderer::SetHtmlText
}\label{wxhtmldcrenderersethtmltext
}
55 \func{void
}{SetHtmlText
}{\param{const wxString\&
}{html
},
\param{const wxString\&
}{basepath = wxEmptyString
},
\param{bool
}{isdir = TRUE
}}
57 Assign text to the renderer.
\helpref{Render
}{wxhtmldcrendererrender
} then draws
60 \wxheading{Parameters
}
62 \docparam{html
}{HTML text. This is
{\it not
} a filename.
}
64 \docparam{basepath
}{base directory (html string would be stored there if it was in
65 file). It is used to determine path for loading images, for example.
}
67 \docparam{isdir
}{FALSE if basepath is filename, TRUE if it is directory name
68 (see
\helpref{wxFileSystem
}{wxfilesystem
} for detailed explanation)
}
70 \membersection{wxHtmlDCRenderer::Render
}\label{wxhtmldcrendererrender
}
72 \func{int
}{Render
}{\param{int
}{x
},
\param{int
}{y
},
\param{int
}{from =
0},
\param{int
}{dont
\_render = FALSE
}}
74 Renders HTML text to the DC.
76 \wxheading{Parameters
}
78 \docparam{x,y
}{ position of upper-left corner of printing rectangle (see
\helpref{SetSize
}{wxhtmldcrenderersetsize
})
}
80 \docparam{from
}{y-coordinate of the very first visible cell
}
82 \docparam{dont
\_render}{if TRUE then this method only returns y coordinate of the next page
83 and does not output anything
}
85 Returned value is y coordinate of first cell than didn't fit onto page.
86 Use this value as
{\it from
} in next call to Render in order to print multipages
91 The Following three methods
{\bf must
} always be called before any call to Render (preferably
94 \begin{itemize
}\itemsep=
0pt
95 \item \helpref{SetDC
}{wxhtmldcrenderersetdc
}
96 \item \helpref{SetSize
}{wxhtmldcrenderersetsize
}
97 \item \helpref{SetHtmlText
}{wxhtmldcrenderersethtmltext
}
100 {\bf Render() changes the DC's user scale and does NOT restore it.
}
102 \membersection{wxHtmlDCRenderer::GetTotalHeight
}\label{wxhtmldcrenderergettotalheight
}
104 \func{int
}{GetTotalHeight
}{\void}
106 Returns the height of the HTML text. This is important if area height (see
\helpref{SetSize
}{wxhtmldcrenderersetsize
})
107 is smaller that total height and thus the page cannot fit into it. In that case you're supposed to
108 call
\helpref{Render
}{wxhtmldcrendererrender
} as long as its return value is smaller than GetTotalHeight's.