If you selecting multiple object from datagrid and passing it to a document template to print the PDF, then you might try the following
Then you can download the PDF. Please note, if you are selecting a lot of objects, this might have performance issues.
So, its better to see if you can do this in the background using modules like process queue 1 by 1 and merge it finally.
Or simply restrict the amount of items being processed for bulk printing.
Here you can find the basics of document generation: https://docs.mendix.com/refguide/generate-document
In order to execute this for a list; pass the list in the microflow and loop through them.