[Tex/LaTex] How to convert a png into pdf using LaTeX

graphicspaper-sizepdfpng

I have a larger png image: width is 5400 pixels and height is 3850 pixels. I need to transform it into a pdf file in SPA3 size, which means 320mm x 450mm. Is there a way to do it with LaTeX? What I think I need, is to be able to specify the paper size explicitly and to tell LaTeX that there should not be anything around the image.

Best Answer

You can use the standalone class which will produce a pdf with no border. If you want a small border you can add [border=<length>] class option.

Notes:

  • As LionelMANSUY mentioned in the comments it is usually preferable to use keepaspectratio, but if specific dimensions of both height and width are required, using `keepaspectratio may conflict with those requirements..

Code:

\documentclass{standalone}
\usepackage{graphicx}
\begin{document}
    \includegraphics[width=320mm,height=450mm]{../images/EiffelWide}
\end{document}