Coder Social home page Coder Social logo

Comments (7)

JeremyPutnam avatar JeremyPutnam commented on May 28, 2024 7

I had a similar issue. I resolved it by making sure 'myFile' was inside braces.
import myFile from './awesome.pdf';

                 {other code}

                <PDF
                       file={myFile}
                       onDocumentComplete={this.onDocumentComplete}
                       onPageComplete={this.onPageComplete}
                       page={this.state.page} />

There may also be issues with pdf types but this might help someone catch a novice mistake.

from react-pdf-js.

FajneFarita avatar FajneFarita commented on May 28, 2024 1

I got the same error. What PDF types are you supporting?

from react-pdf-js.

mikecousins avatar mikecousins commented on May 28, 2024

Does this work on the raw pdf.js library?

https://mozilla.github.io/pdf.js/

I'm guessing it won't as it's common to react-pdf as well. You might want to raise the issue over on their repo as we're kind of stuck to supporting the PDF files that they support.

from react-pdf-js.

philigrane avatar philigrane commented on May 28, 2024

Yes. y download the lastest stable (v1.9.426) from "mozilla.github.io/pdf.js/"
Y attach the files y uses for my test.
mytest.zip

from react-pdf-js.

sparrowzhang28 avatar sparrowzhang28 commented on May 28, 2024

if myfile is base64 code or url ,it will not work, do you have a try?

from react-pdf-js.

Krashna-Saraswat avatar Krashna-Saraswat commented on May 28, 2024

Yes i have same issue. I just copy and paste the code form github.

from react-pdf-js.

mikecousins avatar mikecousins commented on May 28, 2024

Just going to close this to clean up. If you're still experiencing this please re-open.

from react-pdf-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.