Pdf Generation From Html Table

Hi all,

I have a problem that maybe is easy to solve but at this moment i dont know how to do it. I have an html table in a view where i can add dinamically new <td>. What i want is to get this table and print it on a pdf once i have added some new tds with javascript.

Should i send the html code of the table to my controller and print it with the pdf extension?

I am using this pdf extension http://www.yiiframework.com/extension/pdf/.

Thanks in advance,


Yes, I would suggest doing it like you thought: when the table is ready you click a button, then JavaScript sends the table to a controller and the controller prints the table as pdf.


I’ll try this and see what happens :)

I hope the controller opens the pdf automatically and it does not matter that the call is made with javascript…