Generate print preview - searching right approach
<p>Everything bellow will be considered in terms: php, js, html, css.</p>

<p>I'm looking good way to make my users create, preview and print invoices.</p>

<p>User fill form, submit it. With this user's data i have to generate invoice.
I need to make print preview, which can help user check page for mistakes, and if everything is ok, then he will print it. I want to have three print options (three html buttons, for example): from browser (by JS and CSS help), generate pdf or xls.</p>

<p>I select the next approach.</p>

<ol>
<li>invoice template will be made in HTML with placeholders</li>
<li>after user submit form, HTML file will be read and placeholders will be changed by user's data</li>
<li>with help <a href="http://www.mpdf1.com/mpdf/" rel="nofollow">http://www.mpdf1.com/mpdf/</a> i can generate pdf from html</li>
<li>Then i will generate Image file and will send it to browser for preview</li>
</ol>

<p>if everything ok, and user choose and click "simple" print (JS) - 
5. I can print this page(Image) from browser using JS without any request to server.</p>

<p>and user click print pdf - 
5. I will sent him his already generated pdf file, without any new generating.</p>

<p>and user click print xls - 
5. I will generate xls form pdf (I hope it's possible, i did not search yet) and sent it to client</p>

<p><strong>But</strong> if user will find any error on preview, he will go back to form view to fix it and everything from step #2 will be repeated.</p>

<p>Is it rational approach ? especially so long way
HTML -> Image -> Pdf -> XLS.
Or is there any more suitable solution ?</p>

<p>Thanks, everyone.</p>
