WinXPrint_Page (hPrinter, hWnd, x, y, cxLog, cyLog, cxPhys, cyPhys, pageNum, pageCount)
Prints a page
Parameter | Description |
---|---|
hPrinter | The handle to the printer DC to use. To get a printer DC handle user the WinXPrint_Start function |
hWnd | The handle to the window to print from |
x | The x coordinate on the window to print from |
y | The y coordinate on the window to print from |
cxLog | The width in window units to print |
cyLog | The height in window units to print |
cxPhys | The width in printer units to print |
cyPhys | The height in printer units to print |
pageNum | The page number |
pageCount | The total number of pages |
$$TRUE on success or $$FALSE on fail
If this function returns $$FALSE and there are still more pages to print, you should call WinXPrint_Done and not print the remaining pages.
WinXPrint_Page works by playing the Auto Draw records of the specified window into the printer DC, resizing them to match the printer resolution. Margins and clipping to the printable area are handled automatically.
Because the on screen and on paper formats tend to vary, you may want to create an invisible window to store the Auto Draw commands and print from that instead of printing from your main window.
'print the contents of a window on a single page hPrinter = WinXPrint_Start (1, 1, 1, -1, @cxPhys, @cyPhys, "Printing Test", $$TRUE, #hMain) WinXPrint_Page (hPrinter, #hMain, 0, 0, 400, 300, cxPhys, cyPhys, 1, 1) WinXPrint_Done (hPrinter) |