Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If the format is so rigid you need a format like PDF. HTML/CSS is so variable you'll never get it the same on all browsers. Plug Web pages have no real concept of pages (although there is some support for things like CSS print media styling).</p> <p>Also not all people actually have a printer. Trying to force something to be printed is really the wrong approach and will generally put some of your customers off.</p> <p>The minimal solution is to create a receipt page with the emdia print CSS to make it appear responable most of the time.</p> <p>If that's not enough you need to go PDF. Unfortunately that then becomes hard as <a href="https://stackoverflow.com/questions/391005/convert-html-css-to-pdf-with-php#434391">this question regarding HTML+CSS to PDF conversion illustrates</a>. <a href="http://www.princexml.com/" rel="nofollow noreferrer">PrinceXML</a> does an outstanding job at this conversion but it's not cheap. <a href="http://www.tufat.com/s_html2ps_html2pdf.htm" rel="nofollow noreferrer">Html2PDF</a> is the best of the open source bunch but has issues (see that answer for more detail). I've had this same problem in the Java space and for invoices there ending up using <a href="http://jasperforge.org/plugins/project/project_home.php?group_id=102" rel="nofollow noreferrer">Jasper Reports</a>. I haven't really seen an equivalent reporting solution for PHP though. Python has <a href="http://www.reportlab.org/rl_toolkit.html" rel="nofollow noreferrer">reportlab</a>, which seems a likely candidate for doing that kind of job too.</p> <p>Perhaps your best option is to generate the PDF directly. It's a bit more tedious but it avoids the many pitfalls of HTML to PDF conversion. <a href="http://devzone.zend.com/article/1254-PDF-Generation-Using-Only-PHP---Part-1" rel="nofollow noreferrer">This tutorial</a> (<a href="http://devzone.zend.com/article/1255-PDF-Generation-Using-Only-PHP---Part-2" rel="nofollow noreferrer">Part 2</a>) explains how.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload