Coder Social home page Coder Social logo

pdfjs-react's Introduction

Simple example of using PDF.js components with React.

Running

yarn install
yarn start

Browser will be opening at http://localhost:3000/

pdfjs-react's People

Contributors

yurydelendik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pdfjs-react's Issues

Worker created twice during build.

Hi,

Thanks a lot for this reference project. I'm wondering why the worker is being built twice during
an npm run build. The build/ folder contains two copies of the worker code, each around 700KiB.

2019-08-19_13-26

Why is using refs so important in getting actions to execute?

Inside App.js, you defined a Viewer component that has a ref attribute:

<Viewer
        ref={(ref) => this.viewer = ref}
        ...
 />

and it is used when setting scale, zoom and PDF data on the Viewer component.

Could you share some details on why this is necessary? Are there possible alternatives? This seems very out of sync with the normal methods of state management with React, and I'm curious in regards to the why this is used.

Thanks!

Seems incompatible with PDFJS 2.0

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?

The page of pdfjs is error

i'm make a project about the pdf preview, but i found some pdf page font is error code.
such as : i want the pdf can show like this:
right
but i get it like this:
error
Can you help me ?

Pagination

Hi Yury,

This is an amazing project! I've seen many examples, but have found your's to be very helpful! However, I was wondering if we could have a pagination option instead of viewing all the pages one below the other? Probably by using some state management? Looking forward to hearing from you soon!

Multiple documents.

@yurydelendik thanks a lot for the provided example. Is there a way to open 2 and more documents at the same time? for example if we want to compare documents etc.

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.