I am trying to read the size of a PDF file to adjust the size of the next page to the size of the figure. I have had some success, but the figure is still not well adjusted. I could adjust this figure, but I want to automate the adjustment, as I have 150 figures to insert in the file. I also need to add an extra height on the page, to place the caption of the figure. Any suggestion?
%-----------------------------------------------------------------
\setbox0 = \hbox{\includegraphics{01.pdf}}
width = \the\wd0, height = \the\ht0
\newpage
%================================================================================
\eject \pdfpagewidth=\the\wd0 \pdfpageheight=\the\ht0
\begin{figure}
\caption{<name picture>}
\includegraphics{01.pdf}
\end{figure}


