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}.

  • This appears to be off-topic. Could you clarify? Apart from the fact that you are including the diagram in a .tex document, does this have anything to do with TeX?
    – cfr
    Jul 7 '15 at 22:07
  • @cfr the solution is pdfcrop input.pdf output.pdf. Jul 7 '15 at 22:23
  • That doesn't mean this is not off-topic. The question is off-topic, it seems to me. (Note that that solution doesn't actually answer the question, even if it answers a different one.)
    – cfr
    Jul 7 '15 at 22:30
  • 2
    The first two spaces can be clipped by the command \includegraphics which would make this an on-topic problem. But pdfcrop is more elegant of course. For the last spacing issue, we need to see an MWE. We cannot guess what is happening there. Maybe, this space is desired by your template.
    – LaRiFaRi
    Jul 8 '15 at 7:32
  • 1
    @cfr thx for your reminder. I edit the title as How can I remove white margins from a pdf file? Jul 8 '15 at 8:27

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
  • AWESOME!!!! that totally helped me save an inch or two of margin! Mar 20 '18 at 3:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.