2
5 Comments

Contract editor + export in pdf - How ?

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!

posted to Icon for group Developers
Developers
on November 28, 2019
  1. 1

    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.

  2. 1

    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/

    1. 1

      Really interesting but... Damn the price... :p

      1. 1

        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!

        1. 1

          Hey @dshannon I didn't see your answer ! I am very interested :)

Trending on Indie Hackers
6 weeks solo, 2 rejections, finally live but nobody told me marketing would be this hard User Avatar 65 comments Building ExpenseSpy solo, no funding — launching June 17 on iOS & Android User Avatar 36 comments Hi IH — quick update. The MVP is live. User Avatar 34 comments Day 7: 51 people answered my question. I wasn't ready for what they said. User Avatar 18 comments I built a $5/1k-listing CRE data API because CoStar is overkill for first-pass scans User Avatar 16 comments We built a tool that tells you who your competitors are and where they're weak. No signup. Just describe your product User Avatar 10 comments