Is it possible to define a function where the page is resized to exactly the dimension of an mbox? For example, I want to do something like the following:
\documentclass{report}
\thispagestyle{empty}
\begin{document}
\mbox{\Huge buffer}
\end{document}
And have the output be a PDF whose dimension are exactly the size of the bounding box around the word "buffer". Currently, I am using the program pdfcrop to trim the resulting image, but this is a hack. I was wondering if there was a way to do this in TeX natively.