• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

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

 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 22662
127
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 22662
127
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic