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
  • 8,483
  • 2
  • 23
  • 54
Gaurav Saini
  • 744
  • 2
  • 11
  • 22
  • 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,836
  • 21
  • 78
  • 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
  • 20,110
  • 6
  • 54
  • 101
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
  • 791
  • 6
  • 12
0

Flying Saucer supports using XHTML/CSS to create PDFs.

Mark
  • 28,783
  • 8
  • 63
  • 92