Create pdf in backend

Good morning! I need help creating a PDF in the backend. The idea is to take some fixed fields, such as the user's name, and replace them with other data that will come from the database.

I also need to insert a background image, using the path that I will pass.

Finally, I need to generate this file so that the user can download it.

I previously tried to create a custom component to do this, but I ended up not being able to.