Hi! Technically this is certainly possible, but there are several ways to create/request the pdf: manually via the backend buttons or bulk actions or automatically as an email attachment.
Here are a few links that should get you on track with this:
Both these examples focus on the order status, if you want to disable it for certain categories you will need to query the order items using $order->get_items()
and loop through them to check the category or product ID. This does require quite a bit of programming knowledge and is unfortunately beyond the scope of free support.
For email attachments specifically, there’s an example here on the forum that shows how to check for product categories and prevent attachment for any products that don’t fall in a specific category:
Excluding certain categories
I hope the above helps you accomplish what you need!