Browse Source

Compatibility with OpenPDF as alternative to iText 2.1.7

Issue: SPR-16107
pull/1576/head
Juergen Hoeller 7 years ago
parent
commit
9efdadcdca
  1. 5
      spring-webmvc/src/main/java/org/springframework/web/servlet/view/document/AbstractPdfStamperView.java
  2. 16
      spring-webmvc/src/main/java/org/springframework/web/servlet/view/document/AbstractPdfView.java
  3. 4
      src/docs/asciidoc/web/webmvc-view.adoc

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

@ -33,6 +33,11 @@ import org.springframework.web.servlet.view.AbstractUrlBasedView; @@ -33,6 +33,11 @@ import org.springframework.web.servlet.view.AbstractUrlBasedView;
* document with an AcroForm. Application-specific view classes
* will extend this class to merge the PDF form with model data.
*
* <p>This view implementation uses Bruno Lowagie's
* <a href="http://www.lowagie.com/iText">iText</a> package.
* Known to work with iText 2.1.7 as well as its fork
* <a href="https://github.com/LibrePDF/OpenPDF">OpenPDF</a>.
*
* <p>Thanks to Bryant Larsen for the suggestion and the original prototype!
*
* @author Juergen Hoeller

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -30,13 +30,17 @@ import com.lowagie.text.pdf.PdfWriter; @@ -30,13 +30,17 @@ import com.lowagie.text.pdf.PdfWriter;
import org.springframework.web.servlet.view.AbstractView;
/**
* Abstract superclass for PDF views, using Bruno Lowagie's
* Abstract superclass for PDF views. Application-specific view classes
* will extend this class. The view will be held in the subclass itself,
* not in a template.
*
* <p>This view implementation uses Bruno Lowagie's
* <a href="http://www.lowagie.com/iText">iText</a> package.
* Application-specific view classes will extend this class.
* The view will be held in the subclass itself, not in a template.
* Known to work with iText 2.1.7 as well as its fork
* <a href="https://github.com/LibrePDF/OpenPDF">OpenPDF</a>.
*
* <p>Note: Internet Explorer requires a ".pdf" extension, as
* it doesn't always respect the declared content type.
* <p>Note: Internet Explorer requires a ".pdf" extension, as it doesn't
* always respect the declared content type.
*
* @author Rod Johnson
* @author Juergen Hoeller

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

@ -1930,8 +1930,8 @@ dynamically from the model data. The document is the view and will be streamed f @@ -1930,8 +1930,8 @@ dynamically from the model data. The document is the view and will be streamed f
server with the correct content type to (hopefully) enable the client PC to run their
spreadsheet or PDF viewer application in response.
In order to use Excel views, you need to add the 'poi' library to your classpath, and
for PDF generation, the iText library.
In order to use Excel views, you need to add the Apache POI library to your classpath,
and for PDF generation, the common iText 2.1.7 or its fork OpenPDF (e.g. OpenPDF 1.0.4).

Loading…
Cancel
Save