There is a bug in the image loading so that images can't be read from within a jar. It can be reproduced by putting an image inside your resources folder and making an image element that tries to read it and then bundling it into a jar and try to run it.
To make it easier for users to load images I added an extra image DSL constructor that takes a buffered image parameter instead of just a path so users can choose how to load images.
I also added a call to document.close() to the example document as it's recommended by pdfbox :)
There is a bug in the image loading so that images can't be read from within a jar. It can be reproduced by putting an image inside your resources folder and making an image element that tries to read it and then bundling it into a jar and try to run it. To make it easier for users to load images I added an extra image DSL constructor that takes a buffered image parameter instead of just a path so users can choose how to load images. I also added a call to document.close() to the example document as it's recommended by pdfbox :)