Skip to content

Rendering and Conversion

docx_editor does not use the Syncfusion DocumentEditor web service for normal DOCX/SFDT/PDF conversion. The default conversion service is pure Dart and is backed by vyuh_docx.

Conversion Service Boundary

The public contract is DocxConversionService:

MethodInputOutputDefault implementation
importDocxDOCX bytesSFDT JSONDocxReader.loadFromBytes then SfdtExporter.exportToJson
exportDocxSFDT JSONDOCX bytesSfdtReader.read then DocxExporter.exportToBytes
exportPdfSFDT JSONPDF bytesSfdtReader.read then PdfExporter.exportToBytes

VyuhDocxConversionService is the built-in implementation. It has no HTTP dependency, no .NET dependency, and no Syncfusion server dependency.

Editor Import Flow

text
DOCX bytes
  -> DocxImportRequest
  -> VyuhDocxConversionService.importDocx
  -> vyuh_docx DocxReader
  -> vyuh_docx SfdtExporter
  -> Syncfusion documentEditor.open(sfdt)

This allows the Syncfusion editor to open a Word document using SFDT, the format DocumentEditor understands natively.

Save and Export Flow

text
Syncfusion live document
  -> DocxFileGateway.exportSfdt/exportDocx/exportPdf
  -> DocxController save/export/sign/print operation
  -> capability, lifecycle, lock, integrity, and audit checks
  -> host storage, download, or controlled print result

The controller owns the save/export decision. The editor iframe or desktop surface is only the current file source.

SFDT to PDF Flow

When the editor or host asks for PDF through the default service:

text
SFDT JSON
  -> SfdtReader.read
  -> DocxBuiltDocument
  -> PdfExporter.exportToBytes
  -> PdfLayoutEngine / PdfLayoutDocument
  -> PdfDocumentWriter
  -> PDF bytes

Detailed renderer behavior is documented in Vyuh DOCX SFDT to PDF.

Syncfusion Service URL

DocxSyncfusionConfig.serviceUrl is optional. It is reserved for Syncfusion features that still require their service, such as server-side spell check or advanced paste-from-Word behavior. Normal DOCX import/export and PDF generation use VyuhDocxConversionService unless the host injects another DocxConversionService.

Failure Model

Conversion failures are typed:

ErrorMeaning
DocxConversionInputErrorThe request is invalid or missing required content.
DocxConversionServiceErrorThe conversion engine failed while parsing or exporting.

The controller and host can report these errors without conflating them with authorization, lifecycle, storage, or signing failures.