pdf from json request

Any example code for converting json request in to pdf file
satishk@andb wrote:
Wed Dec 05, 2018 6:31 pm
Any example code for converting json request in to pdf file
Sathish,
The question is not clear. Could you please elaborate the question in details?
What do you mean by creating pdf from json request? Where are you trying to implement?
Sathish,
The question is not clear. Could you please elaborate in details?
What do you mean by converting json request to pdf file? What's the requirement for this implementation?
You can use jspdf plugin to achieve this. Below sample code which achieves the same -
var employees = [
{"firstName":"John", "lastName":"Doe"},
{"firstName":"Anna", "lastName":"Smith"},
{"firstName":"Peter", "lastName":"Jones"}
];

var doc = new jsPDF();
employees.forEach(function(employee, i){
doc.text(20, 10 + (i * 10),
"First Name: " + employee.firstName +
"Last Name: " + employee.lastName);
});
doc.save('Test.pdf');