How do I add a related module in a pdf template

I see.

There seems to be some special code for makeing PDF Templates work with related modules in the case of quotes / invoices for instance.

There are some add-ons which might be able to help, or replicate the standard code from invoices and bend it to your needs.

See this post as well:

A no code idea:
You could try to write all the product names into one text-area field via workflows and calculated fields (depending on your trigger and requirements).

If you’re familiar with logic hooks, it might even be much easier to do this via PHP code (though you need to add this one additional unstructured text-field in the tasks to hold the products data).
It seems to be a technical workaround, but most likely way faster than working on the PDF template logic.