I have a workflow that uses one of several tools that crop a generated pdf (either the standalone class with crop=true, or the pdfcrop or dvipng tools). In some cases I want to limit the cropping on one side. Currently, I'm achieving this by doing an \hspace then writing a period. That works, but I want to know if there are more elegant solutions. I just verified that (at least with the dvipng method) writing my period in white also works (\usepackage{xcolor}...\hspace{...}\textcolor{white}.). I also verified that using \hphantom and so on does not work: the extra space generated thereby will be cropped. Any other ideas about how to achieve this---if possible, without loading the xcolor package?
Asked
Active
Viewed 369 times
1
dubiousjim
- 1,035
- 1
- 8
- 14
1 Answers
1
Use pdfcrop only
You can do this with pdfcrop with no need for the \hspace and period. For example...
pdfcrop --margins 10 0 0 0 in.pdf out.pdf
will leave a margin of 10 basic points on the left side of your pdf. The order of the --margins values are left, top, right, and bottom.
You can also add a white border to an already cropped pdf.
pdfcrop --margins 10 in.pdf out.pdf
You can even use a negative margin value to "overcrop", or crop more than the white border. This is especially useful if you need to crop away a box that surrounds your content.
James
- 4,587
- 1
- 12
- 27
--marginflag on pdfcrop, I'd have to determine a different margin width for each. So not ideal for me. But for other workflows, this might be a good option. – dubiousjim Jan 04 '18 at 12:38