This component uses google document viewer or the office365 viewer to show documents.
npm install ngx-doc-viewer --save
@NgModule({
imports: [NgxDocViewerModule]
})
export class AppModule { }
<ngx-doc-viewer [url]="doc" viewer="google" style="width:100%;height:50vh;"></ngx-doc-viewer>
Input:
- url: document url.
- viewer: google or office
- style
Output:
- loaded: google only, notifies when iframe is loaded. Can be used to show progress while loading
.ppt, .pptx, .doc, .docx, .xls and .xlsx
Only files under 25 MB can be previewed with the Google Drive viewer.
Google Drive viewer helps you preview over 15 different file types, listed below:
- Video files (WebM, .MPEG4, .3GPP, .MOV, .AVI, .MPEGPS, .WMV, .FLV)
- Text files (.TXT)
- Markup/Code (.CSS, .HTML, .PHP, .C, .CPP, .H, .HPP, .JS)
- Microsoft Word (.DOC and .DOCX)
- Microsoft Excel (.XLS and .XLSX)
- Microsoft PowerPoint (.PPT and .PPTX)
- Adobe Portable Document Format (.PDF)
- Apple Pages (.PAGES)
- Adobe Illustrator (.AI)
- Adobe Photoshop (.PSD)
- Tagged Image File Format (.TIFF)
- Autodesk AutoCad (.DXF)
- Scalable Vector Graphics (.SVG)
- PostScript (.EPS, .PS)
- TrueType (.TTF)
- XML Paper Specification (.XPS)
- Archive file types (.ZIP and .RAR)