Coder Social home page Coder Social logo

Comments (5)

vishaldhudum avatar vishaldhudum commented on May 28, 2024 1

Never mind,
Following this blog i was able to implement pdfjs-2.3.200-dist in my react app through iframe
https://www.pdftron.com/blog/react/how-to-build-a-react-pdf-viewer/

from pdfjs-react.

chuckshaw avatar chuckshaw commented on May 28, 2024 1

Hi Yury, very nice example here. I'm trying to adapt it to PDFJS 2.0 but I keep running into issues with the line:
let eventBus = new PDFJSViewer.EventBus();

I get error: Cannot read property 'EventBus' of undefined.

I'm currently trying to find a solution, have you ran into this yourself?

import * as PDFJSViewer from 'pdfjs-dist/web/pdf_viewer';

instead of:

import { PDFJS as PDFJSViewer } from 'pdfjs-dist/web/pdf_viewer';

from pdfjs-react.

tianzhich avatar tianzhich commented on May 28, 2024

same problem, can you find solution?

from pdfjs-react.

MythologicalEngineer avatar MythologicalEngineer commented on May 28, 2024

@tianzhich I spent way too much time trying to get it to work, I ended up just loading the viewer.js from the pdfjs project into an IFrame and issuing a load command to it. Not exactly elegant but worked really well.

from pdfjs-react.

vishaldhudum avatar vishaldhudum commented on May 28, 2024

Any updates

@tianzhich I spent way too much time trying to get it to work, I ended up just loading the viewer.js from the pdfjs project into an IFrame and issuing a load command to it. Not exactly elegant but worked really well.

Can you share the code.

from pdfjs-react.

Related Issues (6)

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.