https://jdhao.github.io/2019/11/20/convert_pdf_to_image_imagemagick/

%3d is interpreted literally, so we actually want something like
convert -density 300 file.pdf -quality 90% page.jpg

And the number with a - before it is just added in before the extension.