Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

What for does pdfcrop execute pdftex internally?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

It basically creates a TeX document which includes the original PDF as image(s) while setting the correct clipping parameter to remove the excess space.

You can do something like this manually using the pdfpages package (which uses \includegraphics internally, see also grfguide):

\includepdf[fitpaper,clip,trim=<llx> <lly> <urx> <ury>]{file}

(here ll= lower left, ur = upper right)

The pdfcrop script however does this manually by apparently adjusted the parameters like \pdfhorigin, \pdfvorigin, \pdfpagewidth, \pdfpageheight etc.

The preview package can crop documents down to their true bounding box for you. It works great for pdflatex, but I didn't got it working for latex by myself. The standalone class uses this package and also sets all other necessary parameters (like empty page style, etc.) so that a tight PDF image from e.g. a tikzpicture is produced.

share|improve this answer
    
Do we need to pass -interaction=nonstopmode to pdfcrop? –  xport Jul 9 '11 at 17:33
    
@xport: I never needed to do this. –  Martin Scharrer Jul 9 '11 at 17:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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