A fast, lightweight PDF generator for the Java platform
Version 1.9.1, by David Gilbert, 6 November 2022.
(C)opyright 2013-2022, by David Gilbert. All rights reserved.
OrsonPDF is a PDF generation library for the Java(tm) platform that allows you to create content in PDF format using the standard Java2D drawing API (Graphics2D
). OrsonPDF is light-weight, fast, and has no dependencies other than the Java runtime (version 8 or later). The home page for the project is:
https://github.com/jfree/orsonpdf
The Javadoc page for the PDFDocument class gives an example of typical usage and, if you are already familiar with the Java2D APIs, then all you need to do is add orsonpdf-1.9.1.jar
to your classpath and start coding.
Oracle provides tutorials for Java2D here:
http://docs.oracle.com/javase/tutorial/2d/
There are some demonstration applications included in the JFree Demos project.
OrsonPDF is published to the Central Repository. You can include it in your projects with the following dependency:
<dependency>
<groupId>com.orsonpdf</groupId>
<artifactId>orsonpdf</artifactId>
<version>1.9.1</version>
</dependency>
For developers using the Java Module System, OrsonPDF defines the automatic module name com.orsonpdf.orsonpdf
. Alternatively, a new project (https://github.com/jfree/jfreepdf) has been created that supports Java modules directly but requires Java 11 or later.
You can build OrsonPDF from sources using Maven:
mvn clean install
OrsonPDF is dual licensed. You can use OrsonPDF under the terms of the GNU General Public License version 3 (GPLv3) or later. If you prefer not to be bound by the terms of the GPLv3, an alternative license is available to JFree sponsors.
OrsonPDF integrates the Ascii85OutputStream class written by Ben Upsavs and distributed freely under the (BSD-style) terms listed in the Ascii85OutputStream-license.txt file.
Version 1.9.1 (6 November 2022)
getPDFPath()
method in GraphicsStream
(https://github.com/jfree/orsonpdf/pull/7)Version 1.9 (9 February 2019)
drawString()
method exception when passing an empty string;drawImage()
with null
for BufferedImageOp
;Graphics2D
instance from create()
;com.orsonpdf.orsonpdf
).Version 1.8 (30 November 2017)
drawImage()
with null transform;Version 1.7 (28 September 2015)
PDFGraphics2D.create()
method;PDFGraphics2D.drawImage()
method;Version 1.6 (31 March 2014)
Stroke
implementations (previously only BasicStroke
was recognised);Version 1.5 (5 March 2014)
DRAW_STRING_TYPE
which provides an option to render text as vector graphics, which allows the inclusion of Unicode characters in the output without font embedding;Version 1.4 (18 December 2013)
XREF
table which caused Acrobat Reader to prompt for saving when closing PDFs;Version 1.3 (8 November 2013)
getDeviceConfiguration()
;getClipBounds()
method when the clip is null;Producer
version info;Version 1.2 (12 September 2013)
RadialGradientPaint
support.Version 1.1 (3 September 2013)
drawString(AttributedCharacterIterator, float, float)
using TextLayout
and modified drawGlyphVector()
to fill rather than stroke shapes;Path2D
objects to ensure correct output quality;Page
so it does not add /XObject
to resources if there are no xObjects
;GradientPaint
and Color
;com.orsonpdf.*
);Version 1.0 (31 July 2013)
JFreeGraphics2D
).