Examples

How do I show a PDF in my Swing Application

Here is some simple code adapted from the viewer demo which will
show a PDF in a JFrame. This uses the PagePanel class from the viewer
demo, which handles all of the details of repainting the pdf in a JPanel.

How do I draw a PDF directly to my own Graphics2D object?

Sometimes you may need to draw directly to some other Graphics2D object
instead of directly to an image. A common example is printing. The PDFRenderer
lets you draw directly to a Graphics2D object rather than returning an image.

The following code draws a pdf into the Graphics2D from a BufferedImage