I am working on patient reporting system and using Dompdf to print the reports. The report consist of header and In between them for eg Test report. I am having Issue with determining the end of the content as after that I have to put a statement saying end of report. I have attached two Images hope it makes my question clear.
The problem I am facing.
And the normal flow of the pdf is as follows