Include multiple images at once using rst2pdf

140 views Asked by At

I'm using rst2pdf to collect several images (named A1.png, A2.png, ... etc) from images folder into one pdf file.

to include one image I write the following in file.txt

.. image:: images/A1.png

then run the following in Linux terminal to convert to pdf

cat file.txt | rst2pdf -o file.pdf

is there a way to include all images at once using the name pattern, something like "images/*.png"?

Thank you

1

There are 1 answers

0
Lorna Mitchell On

I'm not sure if I quite understand what you are trying to do, do you want to convert your images into PDFs? For that I recommend you could try ImageMagick's convert tool https://imagemagick.org/index.php

If you need to include all images in one PDF, then create an rst file with an image directive for each of the images to include, and rst2pdf will produce a PDF with all the images (or any other restructuredtext content) in it.