View Full Version : PDF/Excel generation

12 Apr 2012, 5:45 AM
Hello there..,

We have started working on EXT GWT 3, we liked it so far, one of the main requirement is pdf/excel generation for each of the content panel and also for all the contents in a tab.

One way is to use the same data layer as the applicaiton and write code to generate pdf/excel using iText/POI etc. This needs lot of time in writing everything again and when we add or modify something we need to change in many places(pdf, excel, html)

The second way is to transform the html generated to pdf/excel using some of the tools like PD4ML for pdf and just changing the content type for excel. We would like to go for this approach. Any ideas on how I can do this with ext gwt/gwtp and any examples would help well too.

Thank you in advance.

Colin Alworth
13 Apr 2012, 1:58 PM
Unless I'm mistaken, all of the tools you mention for either manipulating and building a PDF/Excel file or translating HTML to PDF/Excel need to run on the server, and cannot be compiled to JavaScript. This leaves either running this aspect of the application on the server, or using an additional browser plugin to transform the page content into these binary output formats.

With a server-side tool, you'll need some input to feed to it - it may be possible to get the full innerHtml of some widget on the page, and send that (along with all CSS currently loaded in the header) to the server to have that rendered as a PDF. Keep in mind though, that some of this content/style may be browser specific, and the HTML to PDF tool probably does not account for these differences, but likely emulates a specific browser/style implementation.

18 Apr 2012, 8:03 AM
I have seen a video on Youtube on how to convert HTML to Excel .xls format, and also how to convert HTML for use on an e-book reader. Here is the link http://www.youtube.com/watch?v=Nj5lNDDBrVQ.