# Document Editor

> Program the Document Editor with its JavaScript API: architecture, loading and saving, editing, formatting, tables, fields, forms, protection and events.

- **Product:** TX Text Control .NET Server
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control .NET Server > Document Editor
- **1264 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/llms-full.txt

---

Once the Document Editor runs in your application, the work shifts to building features on top of it. You learn how the editor works at runtime, how your code loads and saves documents and how it changes the content of a document through the JavaScript API.

If you haven't added the editor yet, start with [Getting Started: Document Editor](https://docs.textcontrol.com/tx-text-control-dotnet-server/getting-started/document-editor/llms-full.txt). The [Document Editor](https://docs.textcontrol.com/tx-text-control-dotnet-server/overview/components/document-editor/llms-full.txt) page in the Overview explains what the editor is and which frontends are available.

### How You Work With the Editor

Users edit documents with the ribbon of the editor. Your code works with the same document in two ways:

- **On the server,** your ASP.NET Core application passes documents to the editor and stores what the editor saves.
- **In the browser,** the JavaScript API, the global `TXTextControl` object, reads and changes the document: its text and formatting, properties, tables, images, fields, sections, tracked changes, comments and protection. Its events tell your code what the user does.

The JavaScript API is the same in every frontend: the ASP.NET Core view, a plain JavaScript page, Angular, React and Blazor. The examples of this section use the ASP.NET Core application of the Getting Started tutorial, and their JavaScript works in the other frontends as well.

Most methods of the API are asynchronous and pass their results to callback functions. Read [JavaScript API](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/javascript-api/llms-full.txt) before the pages about single features, because they all rely on this model.

### Find the Right Page

| If you want to | Read |
|---|---|
| Understand the frontend, the WebSocket middleware and the backend process, and configure the backend | [Architecture](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/architecture/llms-full.txt) |
| Open documents in the editor and store them on your server | [Loading and Saving Documents](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/load-save/llms-full.txt) |
| Read and set the title, author and user-defined properties or embed files in PDF documents | [Document Properties](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/properties/llms-full.txt) |
| Select, insert, find and replace text or undo changes | [Editing Text](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/editing-text/llms-full.txt) |
| Format text, paragraphs and lists, or use styles | [Text and Paragraph Formatting](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/formatting/llms-full.txt) |
| Insert and format tables, or calculate cells with formulas | [Tables](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/tables/llms-full.txt) |
| Insert images, text frames or drawings | [Images](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/images/llms-full.txt), [Shapes](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/shapes/llms-full.txt) |
| Insert charts or barcodes | [Charts and Barcodes](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/charts-barcodes/llms-full.txt) |
| Add page numbers, headers and footers or different page layouts | [Headers and Footers](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/headers-footers/llms-full.txt), [Sections](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/sections/llms-full.txt) |
| Add footnotes or a table of contents | [Footnotes](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/footnotes/llms-full.txt), [Tables of Contents](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/tables-of-contents/llms-full.txt) |
| Insert fields, hyperlinks and bookmarks | [Fields](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/fields/llms-full.txt) |
| Mark parts of a document to find and process them later | [Subtext Parts](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/subtext-parts/llms-full.txt) |
| Build forms that users fill out | [Form Fields](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/form-fields/llms-full.txt), [Content Controls](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/content-controls/llms-full.txt) |
| Prepare documents for signing | [Signature Fields](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/signature-fields/llms-full.txt) |
| Review documents with tracked changes and comments | [Track Changes](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/track-changes/llms-full.txt), [Comments](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/comments/llms-full.txt) |
| Restrict what users can change, or keep parts editable for single users | [Document Protection](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/protection/llms-full.txt) |
| Highlight spelling errors or hyphenate words | [Spell Checking](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/spell-checking/llms-full.txt) |
| Control the view mode, zoom, rulers and status bar or print documents | [Viewing and Printing](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/viewing-printing/llms-full.txt) |
| Change the ribbon, the context menus or the language of the user interface | [Ribbon and UI](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/ribbon-ui/llms-full.txt) |
| Learn how the `TXTextControl` object, callbacks and collections work | [JavaScript API](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/javascript-api/llms-full.txt) |
| React to what users do, or find out when the editor is ready | [Events](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/events/llms-full.txt) |

### Where to Start

1. [Architecture](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/architecture/llms-full.txt): what happens between the browser and the server.
2. [JavaScript API](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/javascript-api/llms-full.txt): how your code talks to the editor.
3. [Loading and Saving Documents](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/load-save/llms-full.txt): get real documents into the editor and back.
4. The page of the feature you need, from the table above.

### Related Sections

- [Mail Merge and Reporting](https://docs.textcontrol.com/tx-text-control-dotnet-server/mail-merge/llms-full.txt): merge the templates that users design in the editor with data.
- [Document Viewer](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-viewer/llms-full.txt): show documents read-only, and let users fill out and sign them.
- [Document Processing](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-processing/llms-full.txt): create and change documents on the server with `ServerTextControl`.

---

## In This Section

- [Architecture](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/architecture/llms-full.txt): Follow a Document Editor session through the frontend, WebSocket middleware and TXTextControl.Web.Server.Core backend: reconnection, ports, logging, scaling.
- [Charts and Barcodes](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/charts-barcodes/llms-full.txt): Charts and barcodes in the Document Editor: chart events and frames, and inserting, changing, exporting and removing barcodes such as QR codes from JavaScript.
- [Comments](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/comments/llms-full.txt): Comments in the Document Editor: add comments and replies from JavaScript, list them with author and time, remove them, show the sidebar and react to events.
- [Content Controls](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/content-controls/llms-full.txt): Load MS Word content controls into the Document Editor as form fields, save them back to DOCX and read tags on the server with ContentControlFieldAdapter.
- [Editing Text](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/editing-text/llms-full.txt): Edit text in the Document Editor from JavaScript: select and insert text, find and replace, undo and redo, clipboard, overwrite mode and keyboard shortcuts.
- [Events](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/events/llms-full.txt): Attach Document Editor event handlers with addEventListener, follow the initialization order and find every JavaScript event with its argument object.
- [Fields](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/fields/llms-full.txt): Work with fields in the Document Editor from JavaScript: text fields, MS Word fields such as MERGEFIELD, hyperlinks, bookmarks and links, and field events.
- [Footnotes](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/footnotes/llms-full.txt): Footnotes in the Document Editor: insert footnotes from JavaScript, set the number format and start number, highlight, list and remove them, footnote events.
- [Form Fields](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/form-fields/llms-full.txt): Create fillable forms in the Document Editor: text, check box, drop-down and date fields from JavaScript, form protection, validation, values and PDF export.
- [Text and Paragraph Formatting](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/formatting/llms-full.txt): Format text in the Document Editor from JavaScript: fonts and colors with Selection, alignment and spacing with ParagraphFormat, lists, tab stops and styles.
- [Headers and Footers](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/headers-footers/llms-full.txt): Add headers and footers in the Document Editor from JavaScript: for all or single sections, first and even pages, their text, distance and page number fields.
- [Images](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/images/llms-full.txt): Insert images into the Document Editor from JavaScript: inline, anchored or at a fixed position from Base64 data, then scale, align, describe and remove them.
- [JavaScript API](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/javascript-api/llms-full.txt): Use the Document Editor's global TXTextControl object in every frontend: init settings, textControlLoaded, callbacks, error handling, promises and collections.
- [Loading and Saving Documents](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/load-save/llms-full.txt): Load documents into the Document Editor and save them: LoadText in the view, loadDocument and saveDocument in JavaScript, a controller that stores DOCX files.
- [Document Properties](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/properties/llms-full.txt): Set the title, author, keywords and user-defined properties of the Document Editor's document from JavaScript, and embed files such as invoice XML in PDF.
- [Document Protection](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/protection/llms-full.txt): Protect documents in the Document Editor: edit modes, document permissions, passwords and editable regions for single users, set from the ribbon or JavaScript.
- [Ribbon and UI](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/ribbon-ui/llms-full.txt): Adapt the user interface of the Document Editor: change the ribbon, add custom tabs and buttons, customize context menus and set the language of the interface.
- [Sections](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/sections/llms-full.txt): Use sections in the Document Editor from JavaScript: insert section breaks, set landscape orientation, columns, page margins and borders, restart page numbers.
- [Shapes](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/shapes/llms-full.txt): Handle drawings with MS Word shapes in the Document Editor from JavaScript: drawing events, frames and marker lines, plus adding text frames with borders.
- [Signature Fields](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/signature-fields/llms-full.txt): Prepare documents for signing in the Document Editor: insert and name signature fields from JavaScript, set signer data and images, and hand them to signing.
- [Spell Checking](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/spell-checking/llms-full.txt): Add TX Spell .NET spell checking to the Document Editor: TXTextControl.TXSpell.Core.SDK, languages, user dictionaries, misspelled words and hyphenation.
- [Subtext Parts](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/subtext-parts/llms-full.txt): Mark parts of a document as subtext parts in the Document Editor: add, read, save and remove them from JavaScript, store data with them and use their events.
- [Tables of Contents](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/tables-of-contents/llms-full.txt): Tables of contents in the Document Editor: mark headings with structure levels, insert, update and remove tables of contents from JavaScript, use their events.
- [Tables](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/tables/llms-full.txt): Insert, format and remove tables in the Document Editor from JavaScript: borders and colors, rows and columns, merged cells, formulas and number formats.
- [Track Changes](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/track-changes/llms-full.txt): Track changes in the Document Editor: set the author, turn tracking on from JavaScript, list, accept and reject tracked changes and show the sidebar.
- [Viewing and Printing](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/viewing-printing/llms-full.txt): Control how the Document Editor shows documents: page view, zoom, ribbon, rulers and status bar, control characters, colors and printing from JavaScript.

---

## Nearby

- **Previous:** [Digitally Sign a PDF](https://docs.textcontrol.com/tx-text-control-dotnet-server/getting-started/pdf/sign/llms-full.txt)
- **Next:** [Architecture](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/architecture/llms-full.txt)
