0

I have a GWT webapp, and there are various tables showing in the pages.

I need to have a mechanism put in the webapp to convert the tables through XML/XSLT files into PDF files.
I researched for PDF file converters and I found the following libraries:

  • apache's FOP
  • iText

But I am getting errors in implementing them. Does GWT support them?

[ERROR] [myGWTProject] - Line 842: No source code is available for type org.apache.fop.apps.FopFactory; did you forget to inherit a required module?    

My webapp relies on GWT concerning both parts the client side and the server side.

Any help is appreciated.

GingerHead
  • 8,130
  • 15
  • 59
  • 93

1 Answers1

2

In all likelyhood, no. GWT only supports a very limited set of JRE features. Unless they specifically designed the library to integrate it with GWT, it will not work.

To use such libraries, usually, you delegate that to your server, you do the job and when ready you return it to the client.

Guillaume Polet
  • 47,259
  • 4
  • 83
  • 117
  • @MikeMyers yes the GWT server can do that. A GWT server is actually only another JEE web application (servlets etc...). By default, it runs on Jetty, but you can make it run on any JEE server (Tomcat, ...) – Guillaume Polet May 07 '12 at 16:13
  • 1
    If you (really) need to generate it on the client side, you can use jsPDF - a JavaScript library that can actually generate PDFs on the client side (even pretty much cross browser). Like all JavaScript code, this can also be executed via GWT (using JSNI). However, I don't know if you can make it work so easily with XSLT... – Chris Lercher May 07 '12 at 16:19
  • Strongly recommend to generate PDFs on server side than client side, as it may will be intensive operation and client browser may have limited resources. So it is best to get generated on Server side. – Seshagiri May 08 '12 at 05:52
  • @MikeMyers no this is completely unrelated. The web application container is only there to run your servlets and manage to dispatch incoming requests to your servlets. It also does a bunch of other stuffs but that's the main feature. – Guillaume Polet May 08 '12 at 09:38