Name | PDF Stream Plugin |
---|---|
Publisher | |
License | Open Source (ASL2) |
Version | 12.30.0 |
Homepage |
...
- HTML
- JSP
- FreeMarker template
- Apache Tiles 2.x definitionApache Tiles 3.x definitiondefinition
Struts2 PDF Stream v2
Apache PDFBox 2
Starting from 2.0.0, HTML into PDF rendering is done by the openhtmltopdf library which uses the Apache PDFBox 2 to create PDF documents. Apache PDFBox 2 is an open source Java tool for working with PDF documents and it is published under the Apache License v2.0.
Apache Struts 2.5
Upgraded to be compatible with Apache Struts 2.5
Java 7
Switched to Java 7
Features Overview
- Direct transformation of HTML, JSP, FreeMarker template and Apache Tiles definition to PDF via Struts2 result
- PDF content styling using CSS
- Support of wide range of characters in PDF thanks to the DejaVu fonts
- Handling of the malformed HTML thanks to the jsoup
...
Showcase application can be downloaded from the Maven Central Repository.
Download struts2-pdfstream-showcase
Contributing
Found a bug or have a feature request? Create a new issue or submit a Pull Request.
...
Copy following jars into your classpath (WEB-INF/lib):
- struts2-pdfstream-plugin-
...
- 2.
...
- 0.0.jar
...
- jsoup-1.9.2.jar
- openhtmltopdf-core-
...
- 0.0.
...
- 1-RC4.jar
...
- openhtmltopdf-
...
- pdfbox-
...
- 0.0.
...
- 1-RC4.jar
...
- pdfbox-2.
...
- 0.
...
- 0.jar
...
- fontbox-
...
- 2.
...
- 0.
...
- 0.jar
If you are using Maven, add this to your project POM:
Code Block |
---|
<dependencies> ... <dependency> <groupId>com.amashchenko.struts2.pdfstream</groupId> <artifactId>struts2-pdfstream-plugin</artifactId> <version>1<version>2.30.0</version> </dependency> ... </dependencies> |
...
If you intend to transform Apache Tiles definition additional jar must be included.
For the Apache Tiles 2.x support add the struts2-pdfstream-tiles
.
Code Block |
---|
<dependency> <groupId>com.amashchenko.struts2.pdfstream</groupId> <artifactId>struts2-pdfstream-tiles</artifactId> <version>1<version>2.30.0</version> </dependency> |
For the Apache Tiles 3.x support add the struts2-pdfstream-tiles3
.
<dependency>
<groupId>com.amashchenko.struts2.pdfstream</groupId>
<artifactId>struts2-pdfstream-tiles3</artifactId>
|
...
Usage
- Install this plugin by adding dependency to your POM or by copying jar jars into /WEB-INF/lib directory.
- Make your action package extend
pdfstream-default
package or addpdfstream
result type. - Use
pdfstream
result type.
...