简体   繁体   中英

Which free Java library can I use to generate PDFs in Java?

I have a need to generate some PDF documents through Java .. Which API or library, etc, can I use to do this in the most effective way ?

EDIT: Added requirements:

I'll be using this for a commercial application, so I'd like to work with a library which is free to use for commercial applications as well ..

Secondly, my work will be like this: I have a pre-defined PDF file which has blank text fields in it. This would be my 'template file', and can be generated manually. Then, within my program, I would then take this file, put data into the text fields and generate new PDFs. And this would be done repeatedly.

So for the above added requirements, what would be the best library for me now ? iText does seem appealing, but it seems I would have to pay for it if I wanted to use it in a commercial app, which I'd like to avoid ..

I am using Apache PDFBox to generate PDF in java

Reference : https://pdfbox.apache.org/

Check out iText:

http://itextpdf.com/

iText可能是最好的,但是如果您不能获得他们的许可证,那么还有Apache PDFBox

If you are creating your PDF templates yourself, then you might want to look at Docmosis - it lets you create templates in Word or OpenOffice with fields that you replace when you render documents. There is a free version you can distribute with your application if your document volumes are low.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM