0

Trying to use ImageMagick in a LaTeX script. I can convert any pdf file to PNG image using ImageMagic. This is what I came up with.

convert -density 300 -quality 90 input.pdf output.png

Is there any way to embed the above code convert -density 300 -quality 90 input.pdf output.png in LaTeX script to convert pdf to an image?

2
  • Could you explain a bit more what your use case is? If you want to convert a pdf file to png then you can use the command you describe in the terminal/command prompt. If you want to include a pdf as a figure in your LaTeX document then you can just use \includegraphics{input}` for a file input.pdf without converting anything. If you want to convert many files and you are thinking of using LaTeX as a scripting language then this is possible but not really a good idea because other scripting languages are much more suited for such a task. So what exactly do you want to do?
    – Marijn
    Commented Aug 29, 2021 at 16:09
  • In general, including an image as pdf is superior to including it as png, as the pdf may contain scalable graphics which will allow for arbitrary resolution (e.g. when zooming in), whereas png files have a fixed resolution (and may become big if you chose a fine resolution).
    – gernot
    Commented Aug 29, 2021 at 16:28

0

You must log in to answer this question.

Browse other questions tagged .