function CallFuncation() {
$.ajax({
type: "POST",
url: "Method",
data: '',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(GetData) {
//generated pdf with download including images
}
});
}
Our ajax response data below
GetData = "<h1>Employee List</h1><table border="1" width="100%"><tbody><tr><th>Sr. No</th><th>Name</th><th>Email</th><th>Photo</th></tr><tr><td>1</td><td>Alpesh</td><td>alpesh@gmail.com</td><td><img width="50px" src="images/1.jpg"></td></tr><tr><td>2</td><td>Rajesh</td><td>rajesh@gmail.com</td><td><img width="50px" src="images/2.jpg"></td></tr></tbody></table>"
We required output in pdf same as below image.