Search code examples
imagepdfrestructuredtextpelican

How do I embed full pdfs using ReStructured Text?


How do I embed a pdf using reStructured Text? With the following directive, I only get the first page.

.. image:: /pdfs/cv.pdf

For context, I'm trying to do this in a Pelican based blog.


Solution

  • A plugin for Pelican called pdf-img description says:

    Searches for any tags within your article for which the source is a PostScript, EPS, or PDF file. It will produce a PNG preview of the file and this PNG will be displayed as the image. This preview will also act as a link to the original file. If the PDF/PS/EPS file is a multi-page document, then only the first page will be used for the preview.

    That explains why you get those results.

    I could find no plugin that "embeds a PDF" (by which I assume you want to embed a PDF viewer within your Pelican blog that would display the entire PDF, allowing the viewer to scroll through it in an iframe or something like that), but you can try searching for others.