# Javascript: TXDocumentViewer.init Method

> Initializes a controller through the legacy browser-global API. The method creates a DocumentViewerController for the supplied container. If `viewerSettings.documentData` is provided, the document is loaded during initialization. The global then references the same controller instance and keeps this method available as `TXDocumentViewer.init()`. The controller's public API can subsequently be accessed directly through `TXDocumentViewer`.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Path:** DS Server > Reference > JavaScript API - Document Viewer > Javascript: TXDocumentViewer.init Method
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/txdocumentviewer/init-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/txdocumentviewer/init-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/txdocumentviewer/init-method/llms-full.txt

---

## On This Page

- [Description](https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/txdocumentviewer/init-method/#description)
- [Syntax](https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/txdocumentviewer/init-method/#syntax)
- [Parameters](https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/txdocumentviewer/init-method/#parameters)
- [Return Value](https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/txdocumentviewer/init-method/#return-value)

---

## Nearby

- **Previous:** [TXDocumentViewer Object](https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/txdocumentviewer/llms.txt)
- **Next:** [ViewerEvents Enumerations](https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/viewerevents/llms.txt)
