quick yahoo search yielded this:
$handle = printer_open();
printer_set_option($handle, PRINTER_PAPER_WIDTH, 500); // number in millimeters
printer_set_option($handle, PRINTER_PAPER_LENGTH, 500); // number in millimeters
printer_set_option($handle, PRINTER_TEXT_ALIGN, PRINTER_TA_LEFT);
printer_close($handle);