Comments (5)
ok, so I managed to set up the PDFTron backend server.
But still not really clear why not to have everything in the WebViewer.js
from webviewer-react-sample.
ref
in WebViewer.js is referring to the actual DOM element, whereas in App.js it's the instance of WebViewer class that we created.
In this sample, App.js is trying to access some variables that are defined in WebViewer.js, so it's calling the getter functions like getInstance
and getElement
on the class instance.
from webviewer-react-sample.
Can’t we just have the following events inside the Webviewer.js
this.webviewer.current.getElement().addEventListener('ready', this.wvReadyHandler);
this.webviewer.current.getElement().addEventListener('documentLoaded', this.wvDocumentLoadedHandler);
So we have everything in one component.
But actually what I am trying to do, is to connect the PDFTron’s backend server by adding
pdftronServer: 'http://localhost:8090/'
to the options. But as a result, I am getting something wrong with rendering - the page renders itself recursively and looks really weird.
Do you know what can be wrong?
from webviewer-react-sample.
You can have everything in WebViewer.js. The sample was demonstrating how other components (one or more) could listen to events from WebViewer, but it's totally up to you :)
from webviewer-react-sample.
from webviewer-react-sample.
Related Issues (20)
- how do we assign a variable value to initialDoc? WebViwer HOT 1
- Redaction annotations created in PDFTron are black-boxed in other viewers HOT 1
- Cant download the pdf in React app after making freeText Annontation HOT 1
- GitHub Pages HOT 17
- GitHub Pages
- Running a local file HOT 4
- About multiple language support for editing pdf text. HOT 1
- network failure when run it on localhost HOT 2
- Sample does not work when npm run build && serve -s build HOT 1
- how to implement Generate DOCX/Word templates with JSON in React JavaScript without a WebViewer HOT 1
- Getting window is not defined HOT 1
- Not able to open large file HOT 4
- Is it possible to disable text selection and text copy from file in WebViewer? HOT 2
- Component re-renders weird when params are added to url HOT 8
- Webviewer is not loading when distribution X-Frame-Options set to DENY HOT 4
- Feature Request: WebViewer - Instance Creator - Iframe on Sharepoint HOT 5
- Typo: The initial doc's value is not capitalized to match the actual file name. HOT 2
- Why do we need to explicitly copy the lib files in the public folder? HOT 2
- Cannot find how to save cropped area in reactjs PDFTron HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webviewer-react-sample.