How to generate PDF

thank you teacher
Is there another way?
If i do not want using a web service, for example - https://www.html2pdfrocket.com/# 2