Bunch of stuff to make PDF reports work reasonably well

this one should be an inject too