Blog

All Blog Posts  |  Next Post  |  Previous Post

Unveiling TTMSFNCWXDocxViewer: Seamless DOCX Viewing for FMX, VCL, and Web

Thursday, October 24, 2024

We are excited to announce the release of TTMSFNCWXDocxViewer, a powerful new visual component that brings DOCX viewing capabilities to FMX, VCL, and WEB. Whether you're building cross-platform applications or focused on specific frameworks, TTMSFNCWXDocxViewer provides a streamlined solution for loading and displaying DOCX files with ease.

TMS Software Delphi  Components

Key Features of TTMSFNCWXDocxViewer

The TTMSFNCWXDocxViewer uses the docxjs library in the background to render the document. You can read more about it here.

1. Flexible Document Loading

TTMSFNCWXDocxViewer gives you multiple ways to load your DOCX files, depending on your needs:

TMS Software Delphi  Components

Base64Document: Load a base64-encoded DOCX file for instant display.
LoadFromFile: Load a document using its full file path.
LoadFromBase64: Simply provide a base64-encoded string to load your DOCX file.
Once the document is successfully loaded, the OnDocumentRendered event will be triggered, providing information such as the total page count.

TMSFNCWXDocxViewer1.LoadFromFile(FileName);
TMSFNCWXDocxViewer1.LoadFromBase64(ABase64String);
TMSFNCWXDocxViewer1.Base64Document.Text := ABase64String

2. Intuitive Navigation Controls

Navigating through large documents is made easy with built-in navigation functions. You can move between pages effortlessly using:

  • PreviousPage: Go back to the previous page, if available.
  • NextPage: Move forward to the next page.
  • ActivePage: Get or set the currently active page number.
  • PageCount: Get the count of pages for the loaded document.

These navigation functions allow for smooth, user-friendly control over document browsing.


3. Event-Driven Interactions for Page Navigation

TTMSFNCWXDocxViewer offers several useful events for monitoring document navigation and user interaction:

OnPageChange: Fires whenever the active page is changed, regardless of the method used to switch pages. It returns the updated page index.
OnPageClick: Triggers when a user clicks on a specific page, returning the index of the clicked page.
OnScroll: Triggers as the user scrolls through the document and provides the index of the active page.
OnScrollEnd: Fires when scrolling ends, again returning the index of the current page.

procedure TForm2.TMSFNCWXDocxViewer1PageChange(Sender: TObject; ActivePage: Integer);
begin
  pageIndexLabel.Text :='ActivePage: ' + (ActivePage + 1).ToString;
end;

These events make it easy to track document navigation and create a responsive user experience.

4. Handle Document Links with Ease

TTMSFNCWXDocxViewer includes built-in functionality for handling clickable links inside DOCX files. When a user clicks a link, the OnLinkClick event will trigger, returning the link’s href without automatically navigating the browser. This event can be customized to define how you want to handle links within your application.

5. Advanced DOCX Rendering Options

TTMSFNCWXDocxViewer provides several rendering options to ensure documents are displayed exactly how you want. These include:

  • InWrapper: Wraps document content for additional layout control.
  • IgnoreWidth / IgnoreHeight: Disables specific dimension rendering for more flexibility.
  • IgnoreFonts: Skips font rendering if unnecessary.
  • BreakPages: Enables page breaking, respecting document structure.
  • RenderHeaders, Footers, Footnotes, Endnotes, Comments: Options to display or hide different parts of the document, ensuring content is displayed as intended.
  • Experimental Features: Enable advanced features such as tab stop calculations and document change rendering (insertions/deletions).

TMS Software Delphi  Components

If you need more control over how documents are rendered, these properties allow you to fine-tune the viewing experience.

Bringing it all together

With TTMSFNCWXDocxViewer, viewing DOCX files becomes a breeze across FMX, VCL, and Web platforms. Whether you’re loading documents from local file or base64 strings, this component simplifies the process while offering smooth navigation, customizable rendering, and responsive event handling. Its flexibility and ease of use make it an invaluable tool for developers needing seamless document integration in their applications.

We’re excited to introduce this new functionality and look forward to seeing how it enhances your projects. Whether you're building professional apps or streamlining document viewing in existing software, TTMSFNCWXDocxViewer opens up new possibilities. Try it out, explore its features, and see how it can fit into your development workflow!

Available Today!

The TTMSFNCWXDocxViewer component is available in the latest update, available today. So go ahead and download the latest version of the TMS FNC WX Pack. The TMS FNC WX Pack is part of the FNC family, so as a reminder, below is an overview of what FNC has to offer.

TMS FNC Components can be used simultaneously on these frameworks


TMS FNC Components can be used simultaneously on these operating systems/browsers


TMS FNC Controls can be used simultaneously on these IDEs



Bradley Velghe




This blog post has received 4 comments.


1. Thursday, October 24, 2024 at 8:25:22 PM

TTMSFNCWXDocxViewer is great for me!
I''ll be happy to explore this new component when I find some free time.
Miro Baláž

Bal? Miroslav


2. Thursday, October 24, 2024 at 8:45:47 PM

New FNC Products: No support of LCL any more ??

Eduard Appelhans


3. Sunday, October 27, 2024 at 5:56:41 PM

I think the component is quite successful.
It still has a few problems, e.g. with the bullet points or with the numbering of directories, but on the whole it works quite well.

Another big highlight would be a viewer for PowerPoint files :-)

Cueni Roland


4. Sunday, October 27, 2024 at 8:55:59 PM

If you encounter problems, please send us the .docx files with which we can reproduce these issues.

Bruno Fierens




Add a new comment

You will receive a confirmation mail with a link to validate your comment, please use a valid email address.
All fields are required.



All Blog Posts  |  Next Post  |  Previous Post