TTMSFNCWXDocxViewer
The TTMSFNCWXDocxViewer is a visual component that let’s you view the contents of a Docx files on the
fly. This component uses the Docx.js library.
Loading a document
You can use the Base64Document to load a base64 encoded document. Or you can use one of the following helper functions to load from other sources:
| function | Description |
|---|---|
LoadFromFile |
Requieres a full path to a document. |
LoadFromBase64 |
Requires the base64 encoded file as a string. |
After the Document has finished loading it will trigger a OnDocumentRendered event which contains the page count of the document.
Use navigation functions to change pages
You can use one of the following functions to navigate through pages.
| function | Description |
|---|---|
PreviousPage |
Returns to the previous page if there is one. |
NextPage |
Goes to the next page if any. |
ActivePage |
Gets the current page number or sets the active page. |
Use events to check page count or active page
You can use the following events when the user scrolls/clicks/navigates to a page.
| Event | Description |
|---|---|
OnPageChange |
Triggers when a page has been changed. It does not matter how the page was changed. Returns the ActivePageIndex |
OnPageClick |
Triggers when a page has been Clicked. Returns the index of the clicked page. |
OnScroll |
Triggers when a user is scrolling. Returns the index of the active page. |
OnScrollEnd |
Triggers when a user has stopped scrolling. Returns the index of the active page. |
Use events to handle link clicks
If a user clicks on a link in the document, the OnLinkClick event will trigger. this event will return the link href and not navigate inside the browser.
Docx Rendering Options
| Property | Description |
|---|---|
| InWrapper | Enables rendering of wrapper around document content. |
| IgnoreWidth | Disables rendering width of page. |
| IgnoreHeight | Disables rendering height of page. |
| IgnoreFonts | Disables fonts rendering. |
| BreakPages | Enables page breaking on page breaks. |
| IgnoreLastRenderedPageBreak | Disables page breaking on lastRenderedPageBreak elements. |
| Experimental | Enables experimental features (tab stops calculation). |
| TrimXmlDeclaration | If true, xml declaration will be removed from xml documents before parsing. |
| RenderChanges | Enables experimental rendering of document changes (inserions/deletions). |
| RenderHeaders | Enables headers rendering. |
| RenderFooters | Enables footers rendering. |
| RenderFootnotes | Enables footnotes rendering. |
| RenderEndnotes | Enables endnotes rendering. |
| RenderComments | Enables experimental comments rendering. |
| Debug | Enables additional logging. |