yarn install
yarn start
Browser will be opening at http://localhost:3000/
Simple example of using PDF.js components with React.
yarn install
yarn start
Browser will be opening at http://localhost:3000/
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!
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?
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!
@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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.