4

It is currently possible to insert a PDF as an image in markdown files through pandoc by doing this:

# Hello World
![My PDF file inserted](my-pdf.pdf)

Then you convert that markdown file with pandoc:

~$ pandoc -s -f markdown-implicit_figures my-document.md -o my-document.pdf

And it works! But pandoc only inserts the first page of my-pdf.pdf.

Is it possible to set which page to insert, or better, which pages range?

Thanks by advance.

2
  • 1
    not really an answer (i don't know if pandoc can do what you want or not), but as a last resort, pdfseparate from poppler-utils can split a multi-page PDF into multiple PDF files. You could then include the specific pages you wanted.
    – cas
    Commented Apr 5, 2021 at 12:23
  • Absolutely, you can also extract one specific page with pdftk. Commented Apr 5, 2021 at 16:48

1 Answer 1

2

Unfortunately, as far as I know, there are only two options:

  • Split the pdf in multiple 1-page documents p1.pdf, p2.pdf, etc., and insert them with
![](p1.pdf)
![](p2.pdf)
  • Use
\includepdf[pages=-]{myfile.pdf}

But this works only if you output tex or pdf documents.

You may find this discussion useful.

You must log in to answer this question.

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