A native C++ library for reading and writing DOCX files with correct ECMA-376 compliance. Call it from C, Python, C#, or any language with a C FFI. Free to develop. Pay when you deploy.
Because virtually every existing library gets the spec wrong in ways that matter.
Most libraries ignore the correct cascade order: docDefaults → table → numbering → paragraph style chain → character style → direct formatting. SmartScribe.Docx implements all six layers correctly.
Bold and italic applied at the run level must XOR against the paragraph default, not simply override it. Getting this wrong produces documents that look different in Word than they should.
DOCX specifies fonts per script slot — ASCII, East Asian, Complex Script, High ANSI — resolved through theme font references. Wrong font resolution is the source of most rendering differences between libraries and Word.
A complete read/write API covering every document element that matters in production.
Open existing DOCX files, modify them, and save. Create new documents from scratch. Full round-trip fidelity.
Write document body from HTML — paragraphs, headings, bold, italic, lists, hyperlinks, inline images. One function call, complete document.
All eight margin values including gutter, header/footer distance, and mirror margins for duplex printing. Twips or inches.
Default, even-page, and first-page variants. Template builder with {PAGE}, {NUMPAGES}, {TITLE}, {AUTHOR}, {CHAPTER} variables.
28 functions with pure C linkage. Call from C, C++, Python (ctypes), C# (P/Invoke), Rust (FFI), Java (JNI), or any language with a foreign function interface.
No network calls, no license server, no telemetry. Works on air-gapped machines, offline development, and locked-down enterprise environments.
Three lines to open a document. Three more to set margins and save.
import smartscribe_docx as ss
# Production: call init_licensed() once at startup
ss.init_licensed("SSDX-XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX")
# Open, modify, save
with ss.DocxDocument("manuscript.docx") as doc:
doc.set_margins(top=1440, bottom=1440, left=1440, right=1440)
doc.set_doc_property("title", "My Novel")
ftr = ss.DocxDocument.build_hf_xml(
is_header=False,
template="Page {PAGE} of {NUMPAGES}",
alignment="center")
doc.set_footer_xml(ss.HF_DEFAULT, ftr)
doc.save_as("output.docx")
# One-shot: HTML string directly to DOCX
ss.DocxDocument.write_html("report.docx",
"<h1>Q3 Report</h1><p>Revenue grew <b>42%</b> YoY.</p>")
using SmartScribe;
// Production init — call once before any DocxDocument
DocxDocument.InitLicensed("SSDX-XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX");
using var doc = new DocxDocument("manuscript.docx");
doc.SetMargins(new DocxMargins {
Top=1440, Bottom=1440, Left=1440, Right=1440 });
doc.SetDocProperty("title", "My Novel");
var ftr = DocxDocument.BuildHfXml(
isHeader: false,
template: "Page {PAGE} of {NUMPAGES}",
alignment: "center");
doc.SetFooterXml(HfType.Default, ftr);
doc.SaveAs("output.docx");
#include "SmartScribeDocx.h"
ssDocx_init_licensed("SSDX-XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX");
SsDocxHandle h = ssDocx_open("manuscript.docx");
ssDocx_set_margins(h, 1440, 1440, 1440, 1440, 720, 720, 0, 0);
ssDocx_set_doc_property(h, "title", "My Novel");
unsigned int sz = 0;
const unsigned char* ftr = ssDocx_build_hf_xml(
0, "Page {PAGE} of {NUMPAGES}", "center", &sz);
ssDocx_set_footer_xml(h, SS_HF_DEFAULT, ftr, sz);
ssDocx_save_as(h, "output.docx");
ssDocx_close(h);
No registration. No credit card. No time limit. The notice goes away when you license it.
Includes DLL, C header, Python binding, .NET binding, examples, and three demo programs.
Develop for free. Pay when your users do.
All licenses are perpetual. Your version works forever. Maintenance renewal (updates) is 20% annually and optional.