In my angular10
in which i have to display a PDF
file as a preview
. So for that i am using ngx-doc-viewer
. My component is look like this
component.html
<ngx-doc-viewer [url]="inputFile.filePath" viewer="mammoth"
style="width:100%;height:60vh">
</ngx-doc-viewer>
component.ts
const reader = new FileReader();
reader.readAsDataURL(inputFile);
reader.onload = (_event) => {
this.inputFile.filePath = reader.result;
}
angular.json
scripts : [
"node_modules/mammoth/mammoth.browser.min.js"
]
When i upload any .doc,.docx,.xlsx
file so that it loads that file in chrome
perfectly but when i try with ngx-doc-viewer
so it is giving an error in chrome's console
Unsupported viewer: 'mammoth'. Supported viewers: google, office.
How can i fix it?