wxPrintout

wxPrintout

Creation Parameters

The printpage_rid parameter is the routine_id for a function that will be called when a page needs to be printed. The function should take three arguments: a this object, page_num integer and a wxDC. You should draw the page into the supplied dc. If you want to cancel the job return a value of zero. Otherwise, you should return a value of 1.

The print_prepare_rid parameter is the routine_id for a procedure that will be called when a page needs to be printed. It should take two arguments, a wxPrintout object and a wxDC. You can use this routine to determine the number of pages required, if you need the DC in order to do so. You should then call set_page_info() so that the correct number of pages will be used. If you don't need this, you can set this parameter to -1, which is the default value.

Functions/Procedures
Supertopics

wxPrintout

[func]
get_page_mm
( atom printout )

Category: wxPrintout

Returns the size of the printer page in millimeters.


wxPrintout

[func]
get_page_pixels
( atom printout )

Category: wxPrintout

Returns the size of the printer page in pixels. These may not be the same as the values returned from wxDC::GetSize if the printout is being used for previewing, since in this case, a memory device context is used, using a bitmap size reflecting the current preview zoom. The application must take this discrepancy into account if previewing is to be supported.


wxPrintout

[func]
get_ppi_printer
( atom printout )

Category: wxPrintout

Returns the number of pixels per logical inch of the printer device context. Dividing the printer PPI by the screen PPI can give a suitable scaling factor for drawing text onto the printer. Remember to multiply this by a scaling factor to take the preview DC size into account.


wxPrintout

[func]
get_ppi_screen
( atom printout )

Category: wxPrintout

Returns the number of pixels per logical inch of the screen device context. Dividing the printer PPI by the screen PPI can give a suitable scaling factor for drawing text onto the printer. Remember to multiply this by a scaling factor to take the preview DC size into account.


wxPrintout

[func]
get_printout_dc
( atom printout )

Category: wxPrintout

Returns the device context associated with the printout (given to the printout at start of printing or previewing). This will be a wxPrinterDC if printing under Windows or Mac, a wxPostScriptDC if printing on other platforms, and a wxMemoryDC if previewing.


wxPrintout

[func]
get_scaling_factor
( atom printout )

Category: wxPrintout

Returns the ratio of screen to printer PPI (Pixels Per Inch). This provides a suitable scaling factor for drawing text onto the printer.


wxPrintout

[func]
is_preview
( atom printout )

Category: wxPrintout

Returns 1 if the printout is currently being used for previewing.


wxPrintout

[proc]
set_page_info
( atom printout, atom min, atom max )

Category: wxPrintout

This routine sets the max and min pages for a printout object. If you need to have the DC of the printer in order to determine the number of pages,