fix #31856: add option to trim whitespace from exported PNG
Merge pull request #1514 from MarcSabatella/trim-option

fix #31856: add option to trim whitespace from exported PNG