I want to create a pdf file with some info generated by the user. This info can be tables, images and text.
My question is, which is the best solution for my problem, is it a server-side solution or client-side?
Note: I am looking for a platform that allow me to do almost everything.
If you want to generate a pdf with different templates then you need to go with front-end. If your template is the same, only the data inside it will be change then you should go with back-end.
You can receive an OutputStream in your generatePDF method. If you pass the response. getOutputStream() to the generate method then the PDF will be written to the response directly.
For server side fpdf is very versatile.
For client side you can try jsPDF
Example(jsPDF):
var doc = new jsPDF();
doc.text(20, 20, 'Hello world.');
doc.save('Test.pdf');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With