DOMpdf Documentation with Code Igniter - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: DOMpdf Documentation with Code Igniter (/showthread.php?tid=5257) |
DOMpdf Documentation with Code Igniter - El Forum - 01-14-2008 [eluser]kevinprince[/eluser] Im trying to do some stuff in Dom PDF and can get data into a pdf and start formatting. The problem is I cant fiqure out how to use the DOMpdf commands, eg how do you after 20 rows go to a new page? Be really handy if we could all working on getting the wiki page a little more up to date for this as a lot of us need to use DOMpdf in our projects. DOMpdf Documentation with Code Igniter - El Forum - 01-14-2008 [eluser]Crimp[/eluser] As I recall, this is done with CSS: page-break: after. (DOMpdf is not exactly a dream when it comes to complex layouts). One solution may be to loop the results and insert a CSS div with page break applied after each 20. Keep in mind that DOMpdf does two passes: one for PHP and the second pass for DOMpdf commands. This allows you to execute all PHP and then act on the results with DOMpdf. DOMpdf Documentation with Code Igniter - El Forum - 01-14-2008 [eluser]kevinprince[/eluser] Here is my code for the view, ive tried the page break css a few ways this way it just makes a few blank sheets. Help appreciated! Code: <html> DOMpdf Documentation with Code Igniter - El Forum - 01-15-2008 [eluser]Crimp[/eluser] You just have to experiment with the options and hack your way. I have done quite complex things with it -- but they were not always logical in terms of how one would think they should be solved at the outset. Glancing at the code, you insert a block paragraph in the middle of the table and expect it to resume with rows on the next page. I suspect DOMpdf does not like that. The HTML needs to be well formed. Since it only applies to block level elements, you'd have to start and end a table for each page. How about going for the second pass and something like new_page() instead? I always did headers and footers etc. on a second pass because it was more reliable. DOMpdf Documentation with Code Igniter - El Forum - 01-15-2008 [eluser]kevinprince[/eluser] Bit busy with other work today, but will have a go tonight on this and let you know. I will try and update the wiki too with more instructions. DOMpdf Documentation with Code Igniter - El Forum - 01-16-2008 [eluser]treworld[/eluser] Make sure your $contacts array is actually spitting out data. Do a print_r on that array first before you send it to domPdf. DOMpdf Documentation with Code Igniter - El Forum - 01-17-2008 [eluser]kevinprince[/eluser] Read the thread first... DOMpdf Documentation with Code Igniter - El Forum - 01-17-2008 [eluser]treworld[/eluser] "page-break-after: always" is correct. Try using <DIV STYLE="page-break-after: always"></DIV>. Again, if you still get blank pages, check your array's data. DOMpdf Documentation with Code Igniter - El Forum - 01-17-2008 [eluser]kevinprince[/eluser] It wasnt the array which was broken, the template code was, basically as Crimp said it wouldn't work within the table. Ive corrected it now and it works fine. If the fault was in the data array then I wouldn't of got any data and would of had error messages. |