From java.awt.print.Printable to PDF


News: From java.awt.print.Printable to PDF

  1. From java.awt.print.Printable to PDF (3 messages)

    When you want to convert a java.awt.print.Printable to a pdf file, your first course of action might be to Google for "java printable pdf". If you do that though, all you get is links about how to send a pdf file to the (hardware) printer in java or how to "read" a pdf file in Java. No one seemed to have written an article about how to convert a java.awt.Printable to a pdf file. This is that article. Ideal for generating PDF's on your server and, for example, emailing them to your users.

    Threaded Messages (3)

  2. License requirements[ Go to top ]

    The author says this uses itext 5.0.2, but should also work with newer versions.

    However, the question really is whether it will work with _older_ versions of itext as well (such as v2.0.8).  

    Itext isn't what it used to be, in version 5 it changed it's licensing to the Affero GPL 3.0 license, which means that you may set yourself up for one major licensing nightmare if you use this solution in a commercial solution and think you don't need to buy their license.  The Affero GPL license ain't like the GPL - it's much more aggressively viral, including adding requirements for networked and web-based solutions.


  3. Itext 2.1.7 also works[ Go to top ]

    Hello all,

    Thanks for the comments! I didn't know about the licensing issue. I’ve tested my solution with itext-2.1.7.jar and I am happy to report that this works just fine, the 2.1.7 jar is drop-in compatible.

  4. Use the Apache FOP which is free for generating PDF in java. We are usign this from ages