Crop white space of pdf and using gs convert to png PDFCROP takes a PDF file as input, calculates the BoundingBox for each page by the help of ghostscript and generates a output PDF file with removed margins.pdfcrop Normally pdfcrop will be installed by the TeX system. https://superuser.com/questions/415707/export-excel-graphs-as-vector-graphics-files-e-g-svgs briss/xltoolbox Export Excel chart to SVG creates an empty file pdfcrop foo.pdf f.pdf gswin64c.exe -dNOPAUSE -sDEVICE=png16m -r600 -sOutputFile=foo.png o.pdf -dBATCH Sub SaveSelectedChartAsPng()