Use PHP specific code or use it accordingly. You can find the code at any search engine. You have to install some tools to use this code after then you will be able to convert any specific document to pdf.
All you have to do is download the PDF and put the code in the right folder, right before the actual HTML file. Then edit the code, and it will work like magic! Please share if you found this useful, or you have any other kind of request that you would like to know more about or need further tutorials. Please do not use this tutorial for commercial purposes.