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

时间:2017-08-30 20:43:20

标签: node.js reactjs pdf-generation single-page-application restful-architecture

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?

1 个答案:

答案 0 :(得分:0)

最好的javascript库是PDF.JS,由Mozilla提供。
您可以使用客户端,也可以使用服务器。
对于移动浏览器,您应该更喜欢服务器端渲染。根据我的经验,客户端渲染只能在桌面上进行。