I usually use pdfcrop to remove white margins of pdf illustrations in LaTeX documents. Using it by command line:
pdfcrop myfigure.pdf
it removes all margins but to avoid me to resize the figure (if it has left and right white margins) I need a way to remove only top and bottom margins. I mean someting like
pdfcrop --margins '- 0 - 0' input.pdf
(where the - should be a way to make pdf crop keep the original margin) to set top and bottom margins to 0 keeping original left and right margins.
Perhaps, if there is a tool to measure the white margins of a (single page) .pdf file, I could write a script to achieve my purpose.
0only the desidered margins, keeping the other unchanged. – Gabriele Jun 01 '18 at 06:23identify figure.pdf, and then subtract the right bounding box value to get the right margin value. – Gabriele Jun 02 '18 at 22:40--bboxadded. – Heiko Oberdiek Jun 03 '18 at 15:12