Palani
Palani

Reputation: 1921

Creating PDF for Java applications

How to create pdf with complex design views in Java?I have tried it using jasper reports.Is there Any Ideas for creating PDF for Income tax forms?.

Upvotes: 2

Views: 1239

Answers (6)

Bhoomika
Bhoomika

Reputation: 26

You can try ITextPDF.jar Add this jar to your application and please go through the examples to know more about the tags and design procedure used for creating a PDF Document. Check this link for a simple exmaple http://itextpdf.com/examples/iia.php?id=12

Upvotes: 0

user986280
user986280

Reputation: 131

one approach that requires very little programming is converting your Java object to XML using the Java Binding API for XML (JABX) and then use apache FOP (XSL-FO) to create the PDF from XML. The adavantage of this approach is that is almost 100% declarative, .i.e no programming involved other than executing jabx and apache fop. If you want a tool to create the XSL-FO template, look at J4L FO Designer

Upvotes: 0

RealHowTo
RealHowTo

Reputation: 35417

Design your complex PDF Form with the appropriate tools, something like Acrobat Professional. Then from your Java code, you generate an FDF file (Form Data Format) and let the PDF Reader do the merging or you do it from the server-side and stream back the result.

Possible solutions to process FDF are Adobe Java FDF Toolkit or Apache PDFBox.

Upvotes: 0

Paul Jowett
Paul Jowett

Reputation: 6581

You could also try Docmosis or JODConverter to do the conversion as long as you can install OpenOffice somewhere. They work on many platforms and can be Java controlled and will save you the hassle of learning the OOo UNO API.

Upvotes: 0

Binary Nerd
Binary Nerd

Reputation: 13902

Have you taken a look at the Apache PDFBox project. I believe you can create PDFs using this library, although it is more commonly used in Lucene to convert PDFs to text to allow indexing.

Upvotes: 1

BalusC
BalusC

Reputation: 1109745

A commonly used Java API to create PDF files is iText. Give it a look. API documentation can be found here, code examples can be found here, a tutorial can be found here.

A good but less widely known Java API is OOo API wherein you can create any OOo document to your taste and finally export to PDF.

Upvotes: 4

Related Questions