writing
DocGen Pro: Template-Driven Document Automation
Presales, sales, and post-sales teams live inside documents such as Technical Proposals, Bills of Quantity, Preventive Maintenance reports, and Handover packages. Every one of them is 80% boilerplate and 20% project-specific detail. Every one of them gets built the same painful way. Open last quarter’s file, find and replace the client name, hope nobody missed a field, export, and repeat. Multiply that by a few hundred documents a year and the real cost is not the typing. It is the inconsistency. A pricing table that did not get updated, a logo that is still the old one, or a section order that drifted between two people building the same proposal six months apart.
DocGen Pro is an internal platform I built to remove that drift entirely. The core idea is simple. A template captures every formatting decision once, including typography, layout, section order, and field placement. Producing a document after that is simply a matter of supplying the content. What makes it effective in practice is everything built around that core.
How it actually generates a document
A section-based template builder lets you construct a template section by section. Each section is tagged as a Header, Body, or Footer zone so it renders in the correct place across every export format. Content is written with a rich-text editor based on TipTap that supports real tables instead of flattened text blocks. Tables extracted from uploaded DOCX or XLSX files are preserved as genuine <table> HTML in the template, and a size picker lets you insert new tables manually.
Fields are represented as placeholders such as {{project_name}} and {{client.company}}. These are pulled from a registry of 123 canonical entries grouped by category, including Project, Client, Company, Team, Pricing, BOQ, PM Doc, and Handover. A click-to-insert panel eliminates the need to memorize placeholder syntax. Images work in the same way. Upload a logo once as a named asset, then reference it with alignment and width parameters such as {{image:company_logo|center|200}}. It renders correctly across PDF, DOCX, and XLSX exports.
Where it stops being just a template engine
Two capabilities extend the platform beyond traditional mail merge.
Auto Analyze and Auto Create
Provide two sample documents and a rule-based engine with 89 field patterns compares them and generates a merged template with canonical placeholder fields automatically. Any newly discovered placeholder that is not already in the registry is registered automatically. Alternatively, upload a single PDF, DOCX, or XLSX file. The system extracts its sections, detects placeholders, and runs a TF-IDF machine learning classifier trained on 279 historical document types to identify the department, category, and document type. A single click saves the result and opens it directly in the Template Builder for review.
Machine learning assisted value entry
When generating a document, the system suggests values for each field from three sources. The current project’s data already stored in the database, frequency-ranked historical values from previous documents of the same type, and registry example values as a fallback. Suggestions appear as clickable chips beneath each field, making document generation primarily a selection process instead of manual typing.
The rest of the platform
Every export, whether PDF, DOCX, or XLSX, is normalized. Em and en dashes become standard hyphens, curly quotation marks become straight quotation marks, and creator or producer metadata is removed from the output file. Templates support versioning through forking, with a complete parent chain that allows users to trace the evolution of a document type. When a template contains a table, a dynamic row editor with live preview allows users to add or remove rows and immediately review the rendered result before exporting.
The platform does not remove judgment from the process. Someone still decides what a proposal should say. It removes the repetitive formatting and validation work that previously stood between that decision and a finished document.