Skip to content

Commit 9efdadc

Browse files
committed
Compatibility with OpenPDF as alternative to iText 2.1.7
Issue: SPR-16107
1 parent efe943d commit 9efdadc

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

spring-webmvc/src/main/java/org/springframework/web/servlet/view/document/AbstractPdfStamperView.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
* document with an AcroForm. Application-specific view classes
3434
* will extend this class to merge the PDF form with model data.
3535
*
36+
* <p>This view implementation uses Bruno Lowagie's
37+
* <a href="http://www.lowagie.com/iText">iText</a> package.
38+
* Known to work with iText 2.1.7 as well as its fork
39+
* <a href="https://github.com/LibrePDF/OpenPDF">OpenPDF</a>.
40+
*
3641
* <p>Thanks to Bryant Larsen for the suggestion and the original prototype!
3742
*
3843
* @author Juergen Hoeller

spring-webmvc/src/main/java/org/springframework/web/servlet/view/document/AbstractPdfView.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -30,13 +30,17 @@
3030
import org.springframework.web.servlet.view.AbstractView;
3131

3232
/**
33-
* Abstract superclass for PDF views, using Bruno Lowagie's
33+
* Abstract superclass for PDF views. Application-specific view classes
34+
* will extend this class. The view will be held in the subclass itself,
35+
* not in a template.
36+
*
37+
* <p>This view implementation uses Bruno Lowagie's
3438
* <a href="http://www.lowagie.com/iText">iText</a> package.
35-
* Application-specific view classes will extend this class.
36-
* The view will be held in the subclass itself, not in a template.
39+
* Known to work with iText 2.1.7 as well as its fork
40+
* <a href="https://github.com/LibrePDF/OpenPDF">OpenPDF</a>.
3741
*
38-
* <p>Note: Internet Explorer requires a ".pdf" extension, as
39-
* it doesn't always respect the declared content type.
42+
* <p>Note: Internet Explorer requires a ".pdf" extension, as it doesn't
43+
* always respect the declared content type.
4044
*
4145
* @author Rod Johnson
4246
* @author Juergen Hoeller

src/docs/asciidoc/web/webmvc-view.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1930,8 +1930,8 @@ dynamically from the model data. The document is the view and will be streamed f
19301930
server with the correct content type to (hopefully) enable the client PC to run their
19311931
spreadsheet or PDF viewer application in response.
19321932

1933-
In order to use Excel views, you need to add the 'poi' library to your classpath, and
1934-
for PDF generation, the iText library.
1933+
In order to use Excel views, you need to add the Apache POI library to your classpath,
1934+
and for PDF generation, the common iText 2.1.7 or its fork OpenPDF (e.g. OpenPDF 1.0.4).
19351935

19361936

19371937

0 commit comments

Comments
 (0)