https://github.com/adangel/java-xml2pdf-example
Creating a PDF document using Apache FOP
https://github.com/adangel/java-xml2pdf-example
fop java pdf
Last synced: 5 months ago
JSON representation
Creating a PDF document using Apache FOP
- Host: GitHub
- URL: https://github.com/adangel/java-xml2pdf-example
- Owner: adangel
- License: apache-2.0
- Created: 2023-01-03T15:05:37.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-31T08:14:53.000Z (over 1 year ago)
- Last Synced: 2025-08-02T16:44:23.885Z (11 months ago)
- Topics: fop, java, pdf
- Language: XSLT
- Homepage:
- Size: 3.47 MB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# java-xml2pdf-example
⇨ [accompanying blog post](blogpost.md)
Example of how to use [Apache FOP](https://xmlgraphics.apache.org/fop/) to create a PDF document
in a simple Java application. The application converts a self-defined XML format using
a XSL stylesheet into [XSL-FO](https://www.w3.org/TR/xsl11/#fo-section) and then into PDF.
**Features:**
* Title page with embedded image
* Table of contents
* Bookmarks in PDF
* Embedded open type fonts
* Self-contained as an executable jar
## Building and running
```shell
./mvnw clean verify
java -jar target/javaxml2pdf-1.0-SNAPSHOT-jar-with-dependencies.jar example/bigdoc.xml
open example/bigdoc.pdf
```
## Examples
* Simple minimal document:
* XML: [example/mydoc.xml](example/mydoc.xml)
* PDF: [example/mydoc.pdf](example/mydoc.pdf)
* Bigger document:
* XML: [example/bigdoc.xml](example/bigdoc.xml)
* PDF: [example/bigdoc.pdf](example/bigdoc.pdf)
## References
*
*
*
*
*
*
## License
Apache License, Version 2.0