Non-identical PNG and PDF images from printing TCanvas

This question has the same issue of different behaviour of PNG and PDF printing, it seems it depends on the environment.