Engineering practice certification-compliance

Certification document templates: a builder on tag markup

Importing docx templates with tag markup, generating protocols with a number pool and random test-field values, lab side-files, and stamp-free draft templates.

310h delivered
Certification document templates: a tag-markup builder

A certification-center employee opens the sixth docx test protocol of the morning and, for the sixth time, types in the same applicant, product, and manufacturer details. Each template lived as its own Word file, and filling went by hand. We folded dozens of scattered docx files into one builder inside the analytics platform, and a new template is now set up by the operator alone, with no programmer.

In the certification business a test protocol, a declaration of conformity, an identification act are filled to a fixed form: the employee drops in the data for one specific product. The client had 70–100 such forms across product categories and technical regulations. Generating a docx is something any library can do. The difficulty is elsewhere: making sure the hundred-and-first template does not run into a queue for the developer.

Snapshot

Sector product certification, B2B market analytics
End client Certificate Analytics
Engagement retainer — a series of specs on the template module (2022–2025)
Project type a template-document builder inside the B2B analytics platform
Work done docx template import with tag markup, generation with a number pool and random values, lab side-files, stamp-free templates, per-company rights
Project date 2022 — main module, then point fixes through 2025
Effort over 300 hours agreed by spec (tag builder 160h; number pool and statistics 65h; stamp-free documents 40h; and a series of fixes)
Team Anton Hersun (project manager) and the analytics-panel developer, who has run this track from day one through today
Tech stack Laravel · Sencha 6 · docx with tag markup · xlsm as an external source
Delivered a module for importing and storing templates, generation through tag markup, a number pool with reservation, random values in test fields, lab side-files, stamp-free templates, separation by company and role

The problem

The client’s staff work with three kinds of template documents: test protocols, declarations of conformity, product identification acts. For each kind there are dozens of templates in circulation across product categories and regulations. The client quoted the figure 70–100. Before, each template was a separate docx: an employee opened the right one and filled it by hand, while copies of the right version scattered across machines.

The client wanted a central template store inside the analytics platform they already ran, with search by type and name, and the system itself generating the document from applicant data. The main question came up at the start, asked plainly: how realistic is it to let staff add new templates to the builder themselves? That question became the axis of the whole project.

Why this is hard. The most fragile thing in template automation is not docx generation but the queue that piles up at the developer a year in: “add one more template”. If every form needs code changes, the module becomes a bottleneck. So we put the contract between operator and system into the document markup itself: the operator marks up a Word file with tags and loads it themselves.

How we did it

1. Tag markup in docx as the contract between operator and system.
The module’s central move (160h): an operator takes an ordinary Word document and places tags like {{field}} where the data should land. The same text gets the same tag. On generation the system parses the markup, builds an input form, and substitutes values. A single template can hold any number of string tags, a thousand if needed. A new template loads through the interface as an ordinary tagged docx: the programmer writes the generator once, and the operator adds forms any number of times. We deliberately did not mark up the existing 70 documents for the client. Which field goes where, only their staff know, and they marked the templates up themselves as work went on.

2. Random values in test fields.
In test protocols some numeric fields hold measurement results within allowed bounds. So the employee doesn’t invent those numbers by hand for each document, we put generation of random values into the markup, straight into such fields at document creation, and later added re-generation on a finished document too. On paper a small thing. In practice it saves time on every protocol.

3. Number pool with reservation (65h).
Every document needs its own registration number from a preset range. We built a number pool: the operator tops it up themselves, a number is reserved against a document, and each company has its own pool. A subtlety surfaced here that we worked out in advance. The number can’t be substituted automatically by tag: in different templates that field is named differently, and the system doesn’t know where to put it. We proposed two paths: a dedicated tag for the number, or a reservation button with manual insertion. The client chose the one that didn’t break markup freedom. We tied the reservation date to the time zone, and later that helped filter documents correctly by reservation date.

4. Lab side-file at generation.
The lab running the tests has its own details, stamp, and accreditation number. We set it up like this: when a lab is selected at generation, a second file forms beside the main document from the text set for that lab, and all template tags apply to both files. No text, no second file. The lab also has a “count dates in reservation” flag that affects how the remaining-number tally is computed.

5. Stamp-free, signature-free templates for drafts (40h).
Staff often send a draft protocol to the client for sign-off, and a draft must carry no stamps or signatures. Before, you’d have had to keep two sets of templates. Instead we added generation of a second file without stamps, plus bulk download of such documents by list: one set of templates covers both final documents and drafts.

6. Per-company rights and roles.
Two companies worked on the templates at the client’s end, and one company’s templates must not show up for the other. We gave each user a company affiliation, gave the administrator a company reference, and templates became visible only inside their own. To that we added separate access roles for the templates section: “TD Employee”, “TD Lead”, later “manager and templates”. And when the client asked to split staff by company before a separate spec was drawn up for it, we did the fix as a bonus, credited against an already-paid order.

Process discipline

The module grew not in one block but as a series of specs, each with an honest estimate. How we treat someone else’s budget is shown better than any description by a couple of episodes.

The client wanted a date tag with auto-recalculation: when the main date changes, the test dates recompute themselves, accounting for the red days of the production calendar. We estimated the work at about 30 hours and talked the client out of it ourselves: “looks simple, costs like a Ferrari to build.” We didn’t even describe it in a spec, to avoid baking a knowingly unprofitable item into the estimate.

Separately the client asked to generate documents in Word and PDF at once, as an archive. We ran test templates and showed that a converter not from Word itself produces discrepancies: extra page breaks, small shifts. We gave the conclusion straight: a manager will send a broken PDF into circulation without looking. We declined the task, though we could have taken it.

And smaller still, in the same direction. In one spec the client asked for “fresh number output”. We looked into it and answered that this wasn’t a fix but an unchecked box in the lab settings, enough to turn on. There was nothing to charge for here.

Results

Metric Value
Hours by spec over 300 hours agreed
Orders a series of template-module specs + point fixes
Operator self-service new templates are marked up and loaded through the interface, with no programmer
Document cases protocols, declarations, identification acts, lab side-files, stamp-free drafts
Numbering number pool with reservation, separate per company
Separation templates by company, access roles for the section

What we got: tag markup right in the docx works as a single contract between human and system, and that’s what takes the main part of the “build one more template” queue off the table. Document registration is handled by the number pool with reservation. Special cases (lab side-file, stamp-free drafts) live on top of one template body, while random values in test fields remove the manual entry of numbers.

Process and timeline

Stage Period Outcome
Template import and storage, tag markup, random values Q1–Q2 2022 160h
Number pool with reservation + statistics tools summer 2022 65h
Lab side-file at generation August 2022 point fix
Fixes: import, comments, copy-with-reservation January 2023 a package of fixes
Stamp-free, signature-free templates May 2023 40h
“My documents”: search and template swap with auto-fill July 2023 point fix
Number-remaining notification August 2023 point fix
In the works: auto-fill from an external Excel 2025 paused by the client

In 2025 the client proposed auto-filling templates from the same fixed-structure Excel file their staff already use in another program, so data is entered once. We worked through the file format and the logic of binding fields to tags, but the client put the launch on pause over an internal reorganization of the tech department. The idea is worked out and ready to launch, when the client’s priority returns.

Team

  • Anton Hersun, Xaver Pro — project manager: the tag format, the markup contract, estimates and spec sign-off.
  • analytics-panel developer — server and client sides of the template module. They have run this track from day one through today: the 2022 module and the 2023–2025 fixes were done by the same person. Edits today are made by the one who wrote this code years ago, and no “the heirs couldn’t make sense of it”.

Screenshots and materials

To be added in a separate pass. We need examples of a marked-up docx and of the generated documents after privacy-processing of specific product names.

If at your certification center the same details get typed into six templates in a row, and fixing one form takes a day, show us three templates and a sample report. We’ll estimate what it takes to move generation inside the system. The estimate is free.

Send templates for a quote →


Scroll to Top