Please note that this will html and css pdf free download shows how to do the conversion . Please use your own different font files and image files in this example Itextsharp.
This example code was done with a simple MVC 4 Application. I Have created a folder named resources and placed the files as follows. First of all we need to read the contents inside a CSS file and an HTML file as a string representation. I tried with the relative path but it didn’t work.
Now we need to using features available in XMLWorker library. First of all I would prefer to register fonts. Please note that we have registered fonts in the following format. Relative location does not work. After that we need to pass the HTML and the CSS as a string for XML Helper.