Is it possible to only import part of a pdf file? For example if I want to import lines 20 - 25 from page X from a pdf file, is this possible?

I am familiar with importing whole documents, or pages using \includepdf, but is this import of sections possible?

Moreover, would this result in a figure, or can it be inserted into "regular" text?

  • Have you tried \includegraphics options page=... and viewport=... yet?
    – AlexG
    Dec 9, 2019 at 9:57
  • includepdf has the option pages=20-25, and includegraphics has page=20. Dec 9, 2019 at 9:58
  • Oh lines, not pages ;-). I completly misread the question. Dec 9, 2019 at 10:32

1 Answer 1


No, you can't import a part of a PDF page as if it were text of your *.tex file, unless you just copy the text out of the PDF and paste it into your *.tex file as a quotation.

Either produce a picture (jpg, png, by taking a screenshot e.g.) and include this as it is (\includegraphics) or within an figure, or copy the text out of the PDF and paste it.

Using the viewport option of the graphics bundle isn't as easy as making a screenshot of the PDF.

  • 2
    Note that if your PDF content is vector-based, you'll be losing quality by taking a screenshot (which is rasterized). But if you "includegraphics" the PDF with cropping, the full PDF content is still present in your output file, increasing file size and possibly including information you don't want present. It's possible, though not trivial, to "truly crop" your PDF file: set the MediaBox by using Inkscape, for example, then "print to PDF" or use a tool like pdftocairo to drop all content outside the MediaBox. Dec 9, 2019 at 10:56
  • @Keks With the Gv Postscript/PDF viewer, lower left and upper right corners of the viewport can easily be determined using the mouse pointer (cross hair).
    – AlexG
    Dec 9, 2019 at 11:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .