This is a small project which only shows how to use Velocity, iText 2.0.8 and Flying Saucer to use the same page for making both html and pdf. There is also a small pdfbox test for testing pdf content.
git clone https://github.com/jelinden/velocitypdfexample.git
cd velocitypdfexample
mvn jetty:run
go to:
http://localhost:8080/velocitypdfexample/index.html
http://localhost:8080/velocitypdfexample/index.pdf
https://velocitypdfexample.herokuapp.com/index.html
https://velocitypdfexample.herokuapp.com/index.pdf