[Tex/LaTex] How to remove white margins from a pdf file

graphicspdfspacing

I create a diagram in Visio and save as a pdf file. There is a large space between the text and the figure, as shown the following:

enter image description here

If I understand well, the problem can be boiled down: how to save a diagram as a pdf file with zero margin (top, bottom, left, right) in Visio.

PS: for the last spacing issue, add \usepackage{caption}.

Best Answer

You can remove white margins from a pdf file with pdfcrop, in the simplest version

pdfcrop file.pdf

which generates a maximally cropped output file named file-crop.pdf. You can also specify new own margins in points (default is zero), and name your output file as you want, as in

pdfcrop --margins 10 input.pdf output.pdf
Related Question