Quote Group items Printing to PDF

When I print to PDF using quote groups I can get them to duplicate however if I include any content after a grouped item on my PDF template it sees that content and duplicates it with every single group even if it is not part of the same table . How do I fix this issue?

For example if I want to show all the product line items groups together then in a section after all of those I want to show the service line item groups this does not work because the first section picks up on the content after and duplicates it each time within it.