# Convert image to pdf a5 with not empty areas

I'm using this command

mogrify -format pdf -page a5  iguana2.jpg


to convert a jpg file into a pdf. The problem is that the result has a white border. I'd like the image to full fill the a5 page (it's ok if borders of the image are lost).

-

If you don't have to use IM, I suggest using LaTeX to realize this. The following tex code is an example.

\documentclass[a5paper]{article}
\RequirePackage[margin=0in]{geometry}
\RequirePackage{graphicx}

\begin{document}

\begin{figure}[!htb]
\centering
%\includegraphics[width=1.0\columnwidth]{example.jpg} # if the width > height
\includegraphics[height=1.0\paperheight]{example.jpg} # if the height > width
\end{figure}

\end{document}


The code is very easy to understand. Use latex compile it.

-