O'Reilly logo

iText in Action: Creating and Manipulating PDF by Bruno Lowagie

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12. Drawing to Java Graphics2D

This chapter covers

  • iText and Java’s Graphics2D

  • java.awt.font vs. com.lowagie.text.Font

  • Swing components and PDF

  • PDF and Optional Content

In the two previous chapters, we’ve been discussing methods to draw graphics and text using iText’s direct content object PdfContentByte. You may have recognized some of the examples from other books on SVG, PostScript, or Java graphics. For instance, all the graphical shapes you drew in chapter 10 also exist in the standard Java Developer Kit (JDK): The package java.awt.geom has objects such as Rectangle2D, Ellipse2D, CubicCurve2D, and so on.

Maybe you’re already familiar with these objects. If that is the case, you can use iText as a PDF engine for all your Graphics2D requirements. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required