How to create PDF editor with NodeJS and React in 6 weeks

One of our clients asked me about possibility to create a tool for sales people to help them to create brochures catalogs and other printed materials. The idea was quite simple. Create a template with placeholders and allow users to fill placeholders by images, texts logos etc. Solution was required to be implemented as Web application accessible from tablets and desktops.

My first estimate was about a month of work of one developer plus some QA, management and deployment/delivery activities. My developers as usual told me that I’m a dreamer and we will have issues with PDF and typography printers for sure and need much more time. But finally we found that I was right.
Our goal was to create a PDF on server based on the template. Thus we had two modules: template based editor to allow user to fill template and template renderer to produce PDF.
As far as its web application the only way was to implement editor with HTML/JS. On server side we was free of any limitations and was able to use any technology. There are a lot of different templating solutions for PDF, but I felt that we will have significant problems with preview of printed material in browser and how it will be actually rendered to PDF and printed. After short discussion we decided to use ReactJS to build our own templating engine and editor. There was several reasons for this:
1. Editor was quite simple but with some very specific requirements. There was no editors which exactly meet our requirements and customization was estimated as more expensive than custom development from scratch.
2. With ReactJS we can use the same code base for generating HTML/CSS version of printed material on server and client. One of the most amazing feature of ReactJS is possibility to render HTML on server (with NodeJS) side with exactly the same code. It helped us many times when clients asked about SEO related things at the end of the project.
As result we had ReactJS component that ideally meets requirement and produce client preview and real material with exactly the same code on back-end and front-end.
The only thing we have to do was convert HTML to PDF on server. One of the most popular or maybe the only one working good solution for HTML to PDF conversion is PhantomJS and corresponding wrapper for NodeJS html-pdf.
All this technologies allowed us to build highly efficient solution. Of course there was some unpredictable issues with not enough RAM for huge documents, with Phantomjs process that stuck, with RGB to CMYK conversion. But in general we delivered working brochures editor with first set of requirements (including user management, document library management, and many other) with one customizable template of printed materials tested and deployed to client’s environment in 6 weeks. The only thing allowed us to do it was correct selection of technologies and team of professional PM, BA, QA, developers in Tesseris Pro.