Generation of pdf PDFBox headless docker container fails Generation of pdf PDFBox headless docker container fails docker docker

Generation of pdf PDFBox headless docker container fails


This wasn't anything to do with running in headless mode as it turns out. The initial errors that were being thrown were the actual error (i.e. the font files were corrupt) and I should have stuck with the investigation of these.

The issue was with the way maven was packaging my application with a mixture of binary and text resources. Adding

<resources>    <resource>        <directory>target/classes</directory>    </resource>    <resource>        <directory>src/main/resources</directory>        <filtering>true</filtering>    </resource></resources><nonFilteredFileExtensions>    <nonFilteredFileExtension>ttf</nonFilteredFileExtension></nonFilteredFileExtensions>

to my maven pom stopped the fonts being mangled.

Thanks for the pointers though.For the record, I did get Xvfb working and the display env variable set, which when working, got me back to the original error about fonts being corrupt. To get Xvfb running to get to this, I had to override the entrypoint on the docker run command to get a bash container, then started my vert.x process from within the container.