I have a requirement to be able to generate and download dynamic pdf, csv files on our application(which supports all international markets). We are using React JS (deployed on Node JS server) and the backend data is provided by Java Restful APIs. What would be the best approach for generating these files(Client-side Vs Server-side). Should React JS generate the files(pdf, csv) based on the data provided by java REST API or should the Java Rest API expose a resource to generate and provide the files(Base 64 string) based on client needs. Is there a way to leverage Node JS here?
I want to take performance, CPU utilization into consideration as the volume would be high.
what open source libraries can I use?
The best javascript library is PDF.JS, it's provided by Mozilla.
You can use is client side, but also server side.
For mobile browser, you should prefer server side rendering. Client-side rendering is only ok on desktop, from my experience.
Here a server side rendering for node js, I successfully used it
For java server you have this one (I didn't try it but it's a apache library).
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