Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React JS/Node JS/Java RESTful API for generating pdf

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?

like image 713
Kumar Avatar asked May 12 '26 05:05

Kumar


1 Answers

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).

like image 173
David Faure Avatar answered May 14 '26 01:05

David Faure