Cannot View Microsoft Office Files with ngx-doc-viewer in Angular App

Discussão em 'Angular' iniciado por sicarius, Fevereiro 28, 2025.

  1. sicarius

    sicarius Guest

    I am working on an Angular application where I need to display different file types (PDFs, images, videos, and Microsoft Office files like .docx, .pptx, and .xlsx). I am using ngx-doc-viewer to render Office files, but they do not load properly, while other file types (images, PDFs, MP4s, etc.) work fine.

    Implementation:

    Implementation

    Issue:

    -Office files do not load or display at all.

    -There are no error messages in the console.

    -The same preSignedUrl works fine when opened directly in the browser.

    -Other file types (PDF, images, videos) are displayed correctly using their respective viewers.

    Troubleshooting Done:

    -Confirmed that preSignedUrl is valid and accessible.

    -Checked if MIME types are correctly set when fetching the file.

    -Tried different viewer options (microsoft, google, etc.), but still no luck.

    -Ensured CORS is properly configured on the backend.

    Questions:

    • What could be causing ngx-doc-viewer to fail in loading Office files while other file types work fine?
    • Are there alternative ways to embed Office documents in an Angular app?
    • Could this be a CORS issue, and if so, how can I debug it effectively? Any help would be appreciated! Thanks.

    Continue reading...

Compartilhe esta Página