Is there a way to sort a set of records, and pull out certain pdf's that are in a portal container.
Short answer: Yes.
Longer answer: It largely depends on what you want to pull out from the portal, and what you mean by "pull out". If you're looking for, say, related records that match a certain search criterion, then you can go to a layout based on that related table, perform the search, and then display the PDFs by one of several methods (container field, Web Viewer, etc.). If you want to export the PDFs to disk, then you can loop over them and use Export Field Contents to dump them into a directory.
But the core of the issue would be to isolate the related records. The easy method is to navigate to a layout based on that related table. More complicated would be to assemble a list of IDs you want to fetch, build a relationship based on a global field, stick the list of IDs into that global, and then loop over a portal based on that relationship instead. But ... why?
Retrieving data ...