Thanks for your interest in our products.
As per your requirements, you need to have separate Header/Footer and page number information for each user, so I think the appropriate solution would be to create PDF documents for each patient separately using Aspose.Pdf for Java and then combine all these individual documents into a single resultant PDF document using Aspose.Pdf.Kit for Java. In order to create a PDF document, you may consider using an XML template and then fill in respective patients data and then convert that XML file into PDF format.
For more information, I would suggest you to please visit the following links
Besides this, you may also considering using another workaround. You may try using the MailMerge feature of Aspose.Words for Java to create individual documents for each patient, merge all these files into a single Document object and then convert the final merged document into PDF format using Aspose.Words for Java. For your convenience, I will forward this thread to respective forum where I believe my fellow workers taking care of Aspose.Words would be in be better position to explain this scenario in more details.