Pages are rendered as pictures (up to 2,000 px) and sent to the model as it asks for them, a page or a band at a time, together with the text layer when the PDF has one. The node drops old page pictures from the context as it goes, so a long statement does not fill the model’s memory.
Scans cost more than text documents; a 50-page scanned statement is the expensive part of a run.