I am trying to build an E-Book using pdf.js and turn.js for my website. I came here. Moreover, they are showing this error. Error Image. what should i do now?
Asked
Active
Viewed 5,198 times
2
-
i read this answers. https://stackoverflow.com/questions/19632777/jquery-flipbook-to-upload-pdfs But i failed. – rezwan Sep 03 '17 at 07:51
-
Can you show us your code please? Also, are you sure that the PDF url is working and returns 200 status? – Mosh Feu Sep 03 '17 at 08:08
-
Actually I didn't write any code by myself. I was looking for plugins or free codes for customization. Then I came to the links provided above. I found it in another question asked stackoverflow before. And I faced trouble implementing them. I post it with hope as someone already implement them and guide me how to do. For note, I'm not expert in javascript. And I also download the full project from the link and run on my pc. But they also give the error. I will attach screenshot in next comment. – rezwan Sep 03 '17 at 08:45
-
Any errors in the `console`? – Mosh Feu Sep 03 '17 at 08:53
-
Error message when run the project in my pc. https://ibb.co/fKSWjF – rezwan Sep 03 '17 at 09:01
-
this is the last link i had. https://github.com/erayakartuna/pdf-flipbook In here it said to define the url of the pdf. i put the pdf and the html page in the same folder. than i write the var DEFAULT_URL = "pdf.pdf"; but still it's giving error. Am i doing anything wrong? – rezwan Sep 03 '17 at 09:03
-
It looks like you're running it on your local machine. Have you tried hosting it on a website? – Anders Carstensen Sep 03 '17 at 09:13
-
Yes, i tried it on my local machine. – rezwan Sep 03 '17 at 09:16
-
Try running it on a real web server - either on the internet, or run Apache/IIS/node.js locally. If it still fails, please take a screenshot of the new error and show it to us. – Anders Carstensen Sep 03 '17 at 09:24
-
@rezwanulislam it seems that you run it on your local machine but without server (the requested url start with `file:///` you should use local **server** such as [http-server](https://www.npmjs.com/package/http-server) – Mosh Feu Sep 03 '17 at 09:24
-
@MoshFeu i installed http-server followed by this tutorial https://www.youtube.com/watch?v=oa9m8321_nw and changed the var DEFAULT_URL = "file:///E:/WebDevelopment/Editor/PDF/webdir/pdfjs/pdf.pdf"; and still it shows nothing except only the loading screen. Screenshot link: https://ibb.co/dASDGv What am i missing? – rezwan Sep 04 '17 at 08:29
-
No errors on the screen. This is a progress. Any errors in the `console`? Also, see if the response for the pdf request returns 200 (in [network](https://developers.google.com/web/tools/chrome-devtools/network-performance/reference#requests) tab). – Mosh Feu Sep 04 '17 at 09:52
-
@MoshFeu it's just creeping me out! localhost:8080 belongs to oracle and it is in localhost:8081. Basically i have no idea what to do or How to do. Can you please give a tutorial link where they describe how to do it? please. – rezwan Sep 05 '17 at 14:12
-
@MoshFeu Error in command line. https://ibb.co/kgigoa Error in localhost:8081 https://ibb.co/kePyZF – rezwan Sep 05 '17 at 14:20
-
@AndersKellerCarstensen please have a look. – rezwan Sep 05 '17 at 14:21
-
@rezwanulislam the error in the command line means nothing. Where are you trying to run your web app? on port 8080 or 8081? – Mosh Feu Sep 05 '17 at 14:24
-
@MoshFeu NO 200 in network tab https://ibb.co/i4DsuF – rezwan Sep 05 '17 at 14:29
-
@MoshFeu http://192.168.0.105:8081/ – rezwan Sep 05 '17 at 14:30
-
@MoshFeu pdf is not showing in network tab. see the screenshot please.. https://ibb.co/f5afEF – rezwan Sep 05 '17 at 14:42
-
I just downloaded the demo from [here](https://mozilla.github.io/pdf.js/getting_started/), run `http-server` on that folder, and it works perfectly.. Have you tried this? – Mosh Feu Sep 05 '17 at 15:23
-
@MoshFeu this is showing. https://ibb.co/bHZU8a my 8080 port is used by oracle. – rezwan Sep 05 '17 at 15:55
-
OK. just click on the viewer.html – Mosh Feu Sep 05 '17 at 15:58
-
@MoshFeu i clicked. But only the frame is there and no button is working. https://ibb.co/cnMdZF – rezwan Sep 05 '17 at 16:01
-
That's strange.. It works for me. And what is the errors in the `console` or `network` now? – Mosh Feu Sep 06 '17 at 04:50
-
@MoshFeu this is showing. But the pdf file is in that folder https://ibb.co/euf7wv. Moreover, when i open the pdf file manually it's open up. But why not automatically ? – rezwan Sep 07 '17 at 15:31
-
I see that the requested url of the pdf is for `127.0.0.1:8081`. Is your site run on this domain too? Or you run it on `localhost:8081`? – Mosh Feu Sep 07 '17 at 15:51
-
@MoshFeu i've noticed that though i changed in my html but when i refreshed the page the changes aren't showing. – rezwan Sep 07 '17 at 15:52
-
I'm installing the xampp server now. – rezwan Sep 07 '17 at 15:55
-
I'm not sure what is your meaning. By the way, you should see the request to the pdf in the `network` tab under `xhr` filter. As you can see in the [demo ](https://mozilla.github.io/pdf.js/web/viewer.html) page. https://i.stack.imgur.com/g4p5y.png – Mosh Feu Sep 07 '17 at 15:55
-
@MoshFeu thanks a lot. Finally i did it. But its just a pdf opener. Not something like filpbook i was looking for. – rezwan Sep 07 '17 at 16:07
-
Maybe [this](https://stackoverflow.com/q/19288332/863110) question will help you.. – Mosh Feu Sep 07 '17 at 16:12