TEJVONTechnologies Pvt. Ltd.
Back to Insights
Engineering · Automation 2 min readSeptember 2026

Generating invoices and agreements from code: what we learned

We generate our invoices, proposals and service agreements as Word files from code. Four small lessons that cost us real time.

T

Surendra — Tejvon

Senior Android & BLE Engineer

Tejvon's business documents are generated from code: GST-compliant invoices, project proposals and service agreements, all as Word files carrying the same brand colours and type. We use a JavaScript library that writes the document format directly.

The benefit is consistency. Every document has the same header, the same table styles and the same numbering, and producing a new one takes minutes. Getting there involved a few lessons that are not obvious from the documentation.

Tables wanted plain arrays. Building rows with an inline map call inside the table definition gave us broken output. Building the array first and passing it in fixed it.

Page numbers are fields, not text. To get a real page number that updates, you have to insert the field structure Word itself uses.

Border colours must be written as full six-character hex values. Short forms that work on the web are not accepted.

Logos need preparing. Our PNG files had to be preprocessed before they would embed cleanly.

None of these is difficult once known. Each took time to find, because a document that is slightly wrong still opens and looks almost right. We now keep these rules in one shared helper, so every new document type starts from a version that already works.

Topics

EngineeringAutomation

Working on a similar challenge?

Let's discuss the architecture before you build.

BLE system design, OTA reliability, and connected product engineering — this is what TEJVON does every day.

Book a Technical Consultation