Hello everyone,
I am writing to you today because I need your developer advice.
A friend and I have been developing for several months a project management tool (react + firebase).
The app is well advanced, and we would like to add a contract editing tool. The goal is for the user to have access to an editable template (a window with a text editor) of a contract. Once amended, the contract must be exportable in pdf format.
We are a little confused about how to approach the problem. Following our research we found the frameworks draft.js and pdf2json, but the way to proceed remains unclear for us.
Have any of you ever crafted a similar feature in an application and could you give us some hints?
Any help is welcome, thank you in advance!
Hi Maxime,
You have a few options here. Your best approach will be to generate an HTML view based on the inputs and convert that to pdf. The best options for React will be the following in order of preference:
https://www.api2pdf.com/convert-html-to-pdf-with-javascript-and-react/
https://github.com/diegomura/react-pdf
https://www.npmjs.com/package/react-native-html-to-pdf
https://github.com/christopherdro/react-native-html-to-pdf
Here is an example tutorial: https://www.pdftron.com/blog/react/react-to-pdf/
Let me know if I can help further.
Prince[1] is a well-known library, the license is very expensive though. But it works great and renders from HTML.
[1] https://www.princexml.com/
Really interesting but... Damn the price... :p
Hey Max, I am working on an API that converts HTML to PDF. It should be ready for some early access users in a few weeks if you are interested!
Hey @dshannon I didn't see your answer ! I am very interested :)