Creation parameters:
Properly scaling the print preview is fairly simple. There are three pieces of data that are required:
You can get the scaling factor required by dividing the results of get_dc_size() by get_page_pixels(). Pass the result to set_user_scale(). Now, you can use coordinates in inches multiplied by the printer ppi (relative to the margins):procedure onPrintPage( atom this, atom page, atom dc ) sequence ppi, factorppi = get_ppi_printer( this ) if is_preview( this ) then factor = get_dc_size( dc ) / get_page_pixels( this ) set_user_scale( dc, factor[1], factor[2] ) else set_user_scale( dc, 1, 1) end if
-- print "Hello World" at 1", 1" wx_puts( 0 & ppi * {1,1} & dc, "Hello World" ) end procedure
See Also: get_zoom, set_preview_frame
See Also: get_preview_frame, set_preview_frame
See Also: get_preview_frame, get_zoom