Print PDF template in many to many

I need to print a pdf with account data and contacts related to this account, how can I do this?

You can go in Contacts List View, filter by Account, select all, then select “Print to PDF”

But if you want to join that together with Account info, you would need some custom code.

On the other hand, the Reports allow for more structured information. I’m not sure if the reports have any option to print to PDF, though… :S

In case I want to merge accounts and contacts, which directories would have to be changed for this?

I really don’t know. I just spent a minute searching and I would start by looking here

https://github.com/salesagility/SuiteCRM/blob/master/modules/AOS_PDF_Templates/formLetterPdf.php

…but you will have to work it out yourself.