Available Now: Explore our latest release with enhanced accessibility and powerful IDP features
By Apryse | 2024 Oct 15
2 min
Tags
angular
docx
view
Looking for an Angular DOCX viewer?
This blog describes how to view Microsoft Office documents in an Angular file viewer app using Apryse’s WebViewer. This includes Microsoft Word, Excel, and PowerPoint formats as well as the legacy formats such as DOC, XLS, and PPT.
With just a few lines of code, you can view files client-side, without server dependencies, Microsoft Office licenses, or third-party software. The Apryse WebViewer directly converts DOCX, XLSX, and PPTX files using JavaScript, and renders them for viewing dynamically.
You can also try our office demo to test your files in WebViewer.
View our full Angular doc viewer demo on GitHub, or visit the documentation for get-started steps and further information on additional functionality.
WebViewer supports more than simply viewing Office documents - you can also edit DOCX files - as well as being able to annotate, mail merge on DOCX templates, edit PDF content, manipulate pages, apply redactions, create and fill forms filling, and much more.
For the purposes of this article, we'll assume that you followed the steps of the Getting Started with Angular guide (or just cloned the GitHub. repo). If that is the case, then you will already have a PDF viewer running in your browser.
Make sure that the DOCX file is somewhere accessible, then pass the URL, blob, file path, or arrayBuffer to initialDoc
property in the WebViewer constructor.
WebViewer({
...,
initialDoc: 'https://myserver.com/myfile.docx',
}, this.viewer.nativeElement)
Alternatively, you can also call loadDocument
with the same parameters once WebViewer has loaded.
WebViewer({
...
}, this.viewer.nativeElement).then(instance => {
instance.UI.loadDocument('https://myserver.com/myfile.docx')
})
If you hadn't already started the app then do so now using 'npm start'.
View the app, by navigating to http://localhost:4200/
.
You can now see the DOCX file within the viewer.
The app automatically reloads if you change any source files.
WebViewer comes with a rich set of APIs to customize the UI. For an idea of the vast possibilities, check out the UI customization guide - and the new Modular UI options. Alternatively you can create your own UI by referencing our open-source UI code.
The process to add Office document viewing and collaboration to your Angular file browser app is straightforward using the Apryse WebViewer, a JavaScript-based MS Office SDK.
See for yourself. Try out Apryse features using your own documents with the interactive demo with Apryse showcase.
Have any questions about Apryse’s SDK or WebViewer? Start a chat on Discord with our solutions engineers or reach out to our sales team for a personalized demo.
Tags
angular
docx
view
Apryse
Share this post
PRODUCTS
Enterprise
Small Business
Popular Content