tags:

views:

513

answers:

4

I am using PDF documents for various purposes using iText library. Its like once class per PDF document. In a way there are a lot of similarities among the classes and the same have been listed below:

  1. The fields have (x,y) location
  2. The field can be wrapped after some no. of words
  3. A field can have a value which is a function of one or more parameters
  4. Subsequent page of PDF has to kept same or different

I am thinking of doing this layout business through a XML file. Any thoughts or innovative ideas of solving this are welcome.

+2  A: 

take a look at PDFBox Library which is now in the incubator of Apache

Ram
I could not find a running example on their site.It would be great if you could provide a example for understanding it.
Gaurav Saini
try the internet wayback machine http://web.archive.org/web/*/http://www.pdfbox.org you should have some examples in their former site
Ram
+1  A: 

PDFBox is nice, Used it before and good good help from the developer. You might want to have a look at XSL:FO. It is an XML based formatting language that can output the result as PDF (and other formats) using Apache:FOP.

stwissel
A: 

What about Prince? It's a FOP engine that uses CSS files as styling, and has a Java API. It's not free though (apart from the free Personal License)

Ben
A: 

Flying Saucer supports using XHTML/CSS to create PDFs.

Mark