One way would be to generate the output as a PDF document. If you go that route, there are at least a couple PDF generation PHP modules out there, such as FPDF and TCPDF you could take a look at.
Alternatively, you could just output it as HTML, and make use of CSS media types to control the printing. (I'd probably favor this unless you need the precise sizing control that a PDF would probably be better at.)