16 September 2013 at 10:42am
I'm a little confused as to where I should call HTML2PDF from.
I followed[url=http://www.ibcscorp.com/work/how-to-html-to-pdf-with-silverstripe/] this advice [/url] and HTML2PDF is working but I'm having trouble getting my head around how I can link to this.
I have made myself a non-page class that pulls the contents of a particular page and formats it in the way I want it (it's a big boring table of the contents of that page). This is fine but I can't work out how to combine the two, ie create a PDF of this HTML file that is generated with a whole load of children and other controls.
It is like I need to generate the HTML first, and then pass all that to my getPDFTimeTable(args) function (that just runs HTML2PDF on the content passed to it in the (args)). I'm just not sure how to do that. What am I missing?
16 September 2013 at 2:57pm
Having tried many libraries for this I can fully recomend http://www.tcpdf.org/
Full set of examples http://www.tcpdf.org/examples.php
No external dependencies, no need for java and converts mostly all the html fine for me without having to fiddle with it