Standalone adds extra to paper width and height

includegraphicspaper-sizepdfpdftexstandalone

I want to convert two or more pictures file into pdf. Searching in TEX.SE it suggested the following (TexLive 2021, pdflatex)

\documentclass[multi=page]{standalone}
\usepackage{graphicx}
\usepackage{pgffor}
\begin{document}
\begin{page}
            \centering\includegraphics[width=5.39in,height=8.46in]{C:/Users/.../Downloads/Images/1}
\end{page}
\begin{page}
                \centering\includegraphics[width=5.39in,height=8.46in]{C:/Users/.../Downloads/Images/2}
    \end{page}
\end{document}

but it changes the paper size to 5.47x8.47! I tried

\usepackage[showframe]{geometry}
\geometry{
    paperwidth=5.39in,
    paperheight=8.46in,
    margin=0in
}

also

\documentclass[border={0pt 0pt 0pt 0pt},multi=page]{standalone}

without any success.

enter image description here

Is that possible to prevent adding this extra amount to page size in standalone?

Best Answer

You are adding spaces, hide them with %:

\documentclass[multi=page]{standalone}
\usepackage{graphicx}
\usepackage{pgffor}
\begin{document}
\begin{page}%%<----
\includegraphics[width=5.39in,height=8.46in]{example-image-duck}%%<---
\end{page}
\end{document}

Related Question