Skip to content

issue using pdf renderer -  #159

@amlwwalker

Description

@amlwwalker

Hi,
I have it working for all other formats except pdf. Is there anything I am doing wrong? I always see this:

image

My code is:

<DocViewer pluginRenderers={DocViewerRenderers} documents={[{uri: `https://rest.fs.neo.org/v1/get/${item?.parentID}/${item?.id}`, fileType: "pdf"}]} />

importing

import DocViewer, {DocViewerRenderers} from "react-doc-viewer";

this works perfectly for all other formats/extensions and the URL works fine in the browser - I can see the pdf.

In the console I see

Warning: Error: Setting up fake worker failed: "Importing a module script failed.".

Interestingly, if I change it to:
<DocViewer pluginRenderers={[PDFRenderer]}
I now see

image

any help appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions