Don't use a portal.
Create a layout based on the portal's table set up with a list view format. Include fields from the student table in the header. The invoices starter solution uses this method for printing invoices so you can open that solution and take closer look to see how this can be done.
In this layout, you can size the text field to be quite large and then specify that it Slide up / resize enclosing part. (See the sliding and visibility section of the Inspector's position tab.)
You can use a script to perform a find or use Go To Related Records to pull up the correct set of portal records to print this out for a given student.
Key facts about sliding layout objects:
- It's only visible in preview mode and when you print/save as PDF...
- All layout objects below and in the same layout part as the slide/resize field need to also be set to slide up and resize.
- Objects in headers and footers will not slide.
- Portals will shrink/slide to fit the number of rows of records, but fields within the portal row will not shrink/slide.
- Container fields will slide only if Top, Left alignment is specified for it in the data formatting section of the Inspector's data tab.
- Consistent side borders are difficult to achieve with sliding fields.