2

I am using PDF documents for various purposes using iText library. Its like one 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.

Joris Schellekens
  • 7,863
  • 1
  • 21
  • 50
Gaurav Saini
  • 746
  • 2
  • 11
  • 21
  • Duplicate of http://stackoverflow.com/questions/212577/how-do-you-create-a-pdf-from-xml-in-java – Mark Jun 30 '09 at 13:52

4 Answers4

2

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

Prabhu R
  • 13,218
  • 21
  • 76
  • 112
1

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
  • 19,752
  • 6
  • 48
  • 92
0

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
  • 821
  • 6
  • 12
0

Flying Saucer supports using XHTML/CSS to create PDFs.

Mark
  • 28,152
  • 7
  • 57
  • 90