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.
Please note This is just a PDF conversion. Nothing to worry. But you can save a few dollars while converting files to PDF.