In this tutorial learn how to convert html to pdf dynamically with fpdf library. I think after going through this article any developer easily solve.
Read this post on click4knowledge.com