• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java-to-PDF with jdk1.4 (or java 5)

 
Mika Tapanainen
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Is it easy to produce the simple PDF documents without third party libraries only using jdk1.4? Maybe in the future java 5 is also available.

Which packages and classes to use in the task?

Thanks,

Mika
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The class libraries that come with the JRE have no provisions for creating PDFs. Check out iText, which is the premier open source library to create PDFs. Its 2.x versions run under Java 1.4, while the 5.x versions requires Java 5.
 
Rob Spoor
Sheriff
Pie
Posts: 20669
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mika Tapanainen wrote:Is it easy to produce the simple PDF documents without third party libraries only using jdk1.4?

No. PDF documents have a complex structure and there are no classes for that in the Java core library.

Maybe in the future java 5 is also available.

Java 6 is even available and Java 7 is on its way, but there is still no PDF support.

Frankly, if you want to create PDF documents, there is one obvious choice: iText. See also AccessingFileFormats for a link and alternatives.
 
Gopi Chella
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure whether we have API in Jdk 1.4 or 1.5. However with help of iText.jar(Third Party Library) we can create or Modify pdf files.

You will get enough information about PDF file creation in the below site

http://www.ehow.com/how_5980444_generate-pdf-using-java.html
 
Mika Tapanainen
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the answers.

The problem is that any third party libraries are strictly not allowed in the environment I'm working with. And we are using currently Java 1.4.

I know many ways to implement the PDF functionality if the third party libraries are allowed.

 
Rob Spoor
Sheriff
Pie
Posts: 20669
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are third party libraries not allowed? Is it because of licensing? Because yes, iText's licensing (AGPL) can be a reason to not use it.

Nothing prevents you from rewriting something similar from scratch, but you should tell your project manager that that will require several months of extra work. Perhaps purchasing a commercial library is cheaper.
 
Mika Tapanainen
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The licensing is the problem. At worst case the both open source and commercial products are not allowed.

I know the producing of the PDF is not simple, I have been involved in several projects where one task has been PDF producing. But now the situation is a lot more challenging
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic