The fitting library from tcolorbox can be used to fit text to boxes. Below is a bare minimum example; see the tcolorbox documentation for how to adjust other properties of the box. Paper size can be set via geometry package.
Note: the library never increases the text size by itself. Instead, you need to specify a base font size that is known to be too big, after which the library will scale it down to fit. (You can compare the effects by removing the \tcbset{fit basedim=35pt} line from the code below.)
\documentclass{article}
\usepackage{fix-cm} % Allow arbitrary font scaling for Computer Modern
\usepackage[margin=0.25in]{geometry} % Just so that the examples fit on the same page
\usepackage{tcolorbox}
\tcbuselibrary{fitting}
\usepackage{lipsum} % Just for dummy text
\begin{document}
\tcbset{fit basedim=35pt} % tcb doesn't enlarge text; it starts with this base dimensional and shrinks text to fit
% So if you need the font to possibly scale up you need to specify a larger size to boot.
\tcboxfit[height=5.8in,width=4.1in]{\lipsum[1]} % A6 size, portrait
\tcboxfit[width=5.8in,height=4.1in]{\lipsum[2]} % A6 size, landscape
\end{document}
