1

I have a pdf containing a plot (testpdf.pdf, for testing purposes I took this [sample][1] one). I would like to include this plot within another document. Unfortunately plot.pdf has a margin at the bottom and right. I would like to include the upper left part say (3in x 5in) of the image and resize this part to a width of 19cm.

In "bigpoints" this translates to the upper left part 216bp x 300bp.

And then tried:

\documentclass{article}
\usepackage[a4paper, landscape, left = 0mm, right = 0mm, bottom = 0mm, top = 13mm]{geometry}
\usepackage{graphicx}

\begin{document}
\fbox{
\includegraphics[bb = 0 300 216 0, clip, width = 19cm]{testpdf}
\end{document}

I used the xelatex compiler. Unfortunately this does not seem to work and the result is empty. Any help/ideas highly appreciated.

  • It's easier to just crop out the bottom right cruft using pdfcrop or some graphics program. – JPi Sep 5 '16 at 15:33
  • unfortunately I do not have access to perl on this machine (an therefore no pdfcrop). Therefore looking for another solution. I also tried using [trim = ...]. But unfortuately I do not know the size of the pdf containing the plot beforehand (since they are generated automatically). It would help if I could find out the totalwidth / totalheight of the pdf to include programmatically (is this possible?) I could then calculate the width / height of the margin. – Fabian Gehring Sep 5 '16 at 15:36
  • Which distribution do you have? – Bernard Sep 5 '16 at 15:50
  • The distcibution I have is miktex 2.9 on win7 – Fabian Gehring Sep 5 '16 at 15:54
  • Your value is negative, try bb= 0 0 216 300. – Ulrike Fischer Sep 5 '16 at 16:13

Your Answer

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

Browse other questions tagged or ask your own question.