php is not designed for that particular purpose. one possible solution can be you care a printable version of HTML let the user print by their own.
Window print() Method[
^]
You can also improve printing quality by using PDF. i.e create the PDF in PHP and send it to client side and again let the client print. Many tools are out there for this purpose, FPDF, MPDF, TCPDF etc. FPDF, MPDF are derived from TCPDF