Coder Social home page Coder Social logo

russcoder / djvujs Goto Github PK

View Code? Open in Web Editor NEW
181.0 9.0 35.0 24.13 MB

DjVu.js is a program library for working with .djvu files online without any connection with the server. DjVu.js Viewer is a widget that allows viewing .djvu files right in the browser and can be easily embedded into any web page.

Home Page: https://djvu.js.org/

License: Other

HTML 2.20% CSS 0.63% JavaScript 97.17%
djvu djvu-documents javascript-djvu djvu-online

djvujs's People

Contributors

aamodio avatar dxniel-19 avatar eggiverse avatar juchym avatar osvaldozoso avatar r-pankevicius avatar russcoder avatar saraporle avatar tchiguel avatar vedro-compota 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

djvujs's Issues

Standard error message for common HTTP response error codes

When embedding djvujs in web pages for digital archives that contents are changing over time I often encounter these common HTTP error responses:

  • 404 Not found : occurs when user clicks some older link.
  • 403 Forbidden : when user doesn't have permission to open the document.
  • 500 Internal server error : humans make software :)

Would like to get a short translatable explanatory message for these responses.

Currently we have (for Not found):

Error: Response status code: 404
Response status text:

image

Import as module

Is there a way I can use your code as a module in node.js? Or I need to insert your files into my project manually in one folder?

Browser extension doesn't work if URL parameters are present

The Chrome browser extension does not work if the URL has parameters, and downloads the djvu file instead.
E.g. I tried a local file:///index.djvu?djvuopts&page=9.djvu&zoom=page. Without the URL parameters the file loads in the browser fine.

Zoom display optionable

Hi RussCoder!
Thank your for your plugin.
I have a new request: Would it be possible to have for the zoom percentage , an option at initialization (like rotation) to choose it, for example: {zoom: xxx} or xxx=percent (50,100,150,200,etc.) ?
I have many cases where I often have to enlarge the zoom to 150~200 to have a usable display. It would be a great help.
Thank you.

feature_request(encoding): decode URL symbols before saving

1. Summary

It would be nice, if DjVu.js will decode URL symbols from filename before file saving.

2. Steps to reproduce

I open the link http://93.174.95.29/main/1852000/0e2bb368201041ee576c34aba7d83347/%D0%91%D1%8D%D1%80%D0%BE%D0%BD%20%D0%A0.%2C%20%D0%9A%D0%B5%D1%80%D1%80%20%D0%9D.%2C%20%D0%9C%D0%B8%D0%BB%D0%BB%D0%B5%D1%80%20%D0%9D.%20-%20%D0%A1%D0%BE%D1%86%D0%B8%D0%B0%D0%BB%D1%8C%D0%BD%D0%B0%D1%8F%20%D0%BF%D1%81%D0%B8%D1%85%D0%BE%D0%BB%D0%BE%D0%B3%D0%B8%D1%8F%20%D0%B3%D1%80%D1%83%D0%BF%D0%BF%D1%8B_%20%D0%BF%D1%80%D0%BE%D1%86%D0%B5%D1%81%D1%81%D1%8B%2C%20%D1%80%D0%B5%D1%88%D0%B5%D0%BD%D0%B8%D1%8F%2C%20%D0%B4%D0%B5%D0%B9%D1%81%D1%82%D0%B2%D0%B8%D1%8F.djvu in Firefox with DjVu.js → I click to Save → I look filename of downloaded file.

3. Expected behavior

Бэрон Р., Керр Н., Миллер Н. - Социальная психология группы_ процессы, решения, действия.djvu

4. Actual behavior

%D0%91%D1%8D%D1%80%D0%BE%D0%BD%20%D0%A0.%2C%20%D0%9A%D0%B5%D1%80%D1%80%20%D0%9D.%2C%20%D0%9C%D0%B8%D0%BB%D0%BB%D0%B5%D1%80%20%D0%9D.%20-%20%D0%A1%D0%BE%D1%86%D0%B8%D0%B0%D0%BB%D1%8C%D0%BD%D0%B0%D1%8F%20%D0%BF%D1%81%D0%B8%D1%85%.djvu

5. Notes

You can have problems with link above.

  1. If you in Russian Federation, АнтиЗапрет or its alternatives may be required.
  2. Direct link may be changed; actual links for this book you can find here.

Thanks.

[Extension] Embed file path into URL for reloading

Feature Request: Embedding the path to the file you are viewing into the URL would make it so on reload, close/reopen, and bookmark you could save and automatically return to the file you were viewing. Especially relevant for the firefox extension where the file:// syntax doesn't work.

Check if filetype/link is openable

My suggestion is to return the home page with an error message when an unreadable link and file (the file type is different than djvu) is given

Dynamic zoom

Could you please implement zoom scaling relative to viewport size (fit to page and width) ?

For example see pdf.js viewer:
pdf.js viewer navigation bar

Wrong size of the "hidden text" words

Hi RussCoder, first congratulations for this great work! Added links to my djvu.hu website! ;-) I have a project that edits DjVu in the browser, but it's outdated and requires exporting to PNG files plus XML. Could be largely improved with your APIs. ;-) https://sourceforge.net/projects/webdjvutexted/

Now the bugreport: the words in hidden text layer do not cover the bounding box of the underlying image-word, this makes text selection a bit difficult. Trying to "drag" the selection, but it's not "coming".

A possible solution could be to add some spacing to letters so that words will be as long as the bounding box (at least as I remember I did that in my editor).

Attached a screenshot with example. This shows that "hidden text layer" words are too short compared to visible image. Causing trouble selecting certain parts.

djvu-js

Thank you, keep up the good work!

Public library files are not working

Hi RussCoder
your work on DjVu format is really welcome, thank you a LOT!
I think the JS technology will be the best option for this document format

it looks that files delivered from an Italian online library (http://emeroteca.braidense.it) are not working even when the file is downloaded locally. it would be great in the future to use your browser extension instead of the actually unsupported plugins.
link to the single document:
http://emeroteca.braidense.it/export/gea/172/FASC_52542.djvu

link to the web page
http://emeroteca.braidense.it/gea/indice_giorni.php?IDTestata=172&CodScheda=00FJ&Alph=C&OB=titolo&OM=&SearchString=&SearchField=&PageRec=25&PageSel=3&PB=1&Anno=1879&Mese=12
just click on the issue identified by numbers under the column "Giorno" (day in italian.

my opinion is that DjVu files do contain subpages links

thank you for any help
kind regards
Gianandrea

About Djvu picture size is 2-3M can't preview in Firefox browser

a djvu picture with 2-3M size can't loading in Firefox browser. The following is the error message:
Exception { name: "NS_ERROR_FAILURE", message: "", result: 2147500037, filename: "file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js", lineNumber: 2, columnNumber: 0, data: null, stack: "logarithmicScale@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2:333643\ndrawImageOnCanvas@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2:333961\nupdateImageIfRequired@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2:333281\ncomponentDidMount@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2:332815\nhl@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2:163891\nNs@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2:180826\nt.unstable_runWithPriority@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2:200219\nVo@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2:122578\njs@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2:177563\ngs@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2:173647\nYo/<@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2:122801\nt.unstable_runWithPriority@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2:200219\nVo@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2:122578\nYo@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2:122748\nGo@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2:122681\nvs@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2:173743\nnotify@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2:241179\nm</t.notifyNestedSubs@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2:241814\nm</t.handleChangeWrapper@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2:241882\nd@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2:248907\nwi/this.eventMiddleware/</<@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:36732\nc/</<@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:15195\nfo/</</<@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:2267\ndispatch@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2:250703\nQo/<@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:4201\nza.PUT/<@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:8286\nxa@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:6222\nOa@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:6430\n_a@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:6276\nza.PUT@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:8241\nXa/l<@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:12866\nd@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13784\nf@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13296\ns@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13569\npromise callbackMa@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:7825\nXa/l<@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:12787\nd@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13784\nf@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13296\ns@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13569\nza.SELECT@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:10243\nXa/l<@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:12866\nd@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13784\nf@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13296\ns@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13569\nza.SELECT@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:10243\nXa/l<@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:12866\nd@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13784\nf@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13296\nXa@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13061\nza.FORK/<@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:9654\nka@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:6313\nza.FORK@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:9633\nXa/l<@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:12866\nd@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13784\nf@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13296\ns@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13569\nl@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:8086\nDa/e</e.put@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:7569\nDa/e.put@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:7743\nc/</<@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:15208\nfo/</</<@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:2267\ndispatch@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2:250703\nQo/<@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:4201\nza.PUT/<@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:8286\nxa@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:6222\nOa@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:6430\n_a@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:6276\nza.PUT@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:8241\nXa/l<@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:12866\nd@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13784\nf@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13296\ns@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13569\npromise callbackMa@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:7825\nXa/l<@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:12787\nd@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13784\nf@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13296\ns@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13569\nza.SELECT@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:10243\nXa/l<@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:12866\nd@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13784\nf@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13296\ns@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13569\nza.PUT/<@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:8336\nxa@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:6222\nOa@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:6430\n_a@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:6276\nza.PUT@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:8241\nXa/l<@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:12866\nd@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13784\nf@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13296\ns@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13569\npromise callbackMa@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:7825\nXa/l<@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:12787\nd@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13784\nf@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13296\ns@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:13569\npromise callbackMa@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:7825\nXa/l<@file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9:12787\n" }
djvu_viewer_0.5.1.js:2:160391
ll file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
callback file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
da file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
hl file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
Ns file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
unstable_runWithPriority file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
Vo file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
js file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
gs file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
Yo file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
unstable_runWithPriority file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
Vo file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
Yo file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
Go file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
vs file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
notify file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
notifyNestedSubs file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
handleChangeWrapper file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
d file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
eventMiddleware file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
c file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
fo file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
dispatch file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
Qo file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
PUT file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
xa file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
Oa file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
_a file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
PUT file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
l file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
d file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
f file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
s file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
(异步:promise callback)
Ma file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
l file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
d file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
f file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
s file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
SELECT file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
l file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
d file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
f file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
s file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
SELECT file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
l file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
d file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
f file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
Xa file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
FORK file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
ka file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
FORK file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
l file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
d file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
f file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
s file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
l file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
put file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
put file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
c file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
fo file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
dispatch file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
Qo file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
PUT file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
xa file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
Oa file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
_a file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
PUT file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
l file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
d file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
f file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
s file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
(异步:promise callback)
Ma file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
l file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
d file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
f file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
s file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
SELECT file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
l file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
d file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
f file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
s file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
PUT file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
xa file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
Oa file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
_a file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
PUT file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
l file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
d file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
f file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
s file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
(异步:promise callback)
Ma file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
l file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
d file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
f file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
s file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
(异步:promise callback)
Ma file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
l file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
d file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
f file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
Xa file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
FORK file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
ka file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
FORK file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
l file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
d file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
f file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
s file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
l file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
put file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
put file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
xa file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
Oa file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
_a file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
put file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
c file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
fo file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:9
z file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
onload file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
(异步:EventHandlerNonNull)
processFile file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2
onChange file:///C:/Users/zbwt/Desktop/djvu/djvu_viewer_0.5.1.js:2

Browsing local files

First, much thanks for this super-useful app, it's good complement to pdf.js when browsing a lot of scientific books and papers.

When trying to open local file via Firefox, either with file:// link, drag-and-drop, or opening via Windows Explorer "Open with..." menu, djvu.js doesn't open and download dialogue is shown.
This is contrary to how djvu.js handles URLs to DJVU files, and contrary to pdf.js which can be used to open local documents "directly".

The task contains an incorrect sequence of functions!

feature_request(remote): permalinks to pages of remote documents

1. Summary

It would be nice, if would be possible open links to specific pages of remote DjVu documents.

2. Example of expected behavior

User open https://testuser7.narod.ru/School/Babenko.djvu#page=14 → this page open in browser:

DjVu example

3. Argumentation

Currently, for DjVu:

    person who shares a link and/or the person who wants to read have to spend a lot of time.

It would be nice, if process will much easier. First person add to link with DjVu document #page=$number_of_page → second person open this link and immediately reads the necessary page.

3.1. Currently behavior

I can't find browser extensions, which allow to be possible permalinks to DjVu pages. That share link to DjVu page, I need:

  • Convert DjVu to PDF → upload converted PDF to remote hosting.

Or users, who want to see the contents of the link, needs:

  • Download DjVu → manually find specific page.

3.2. Reasons of permalinks to pages

DjVu (as PDF, FB2 and EPUB) is popular books format.

  1. It would be nice, if people will confirm their words with links to sources of information. I try as often as possible confirm my words authoritative sources.
  2. Users may want to share information from specific pages of DjVu books as peoples regularly share links from another types of web pages.

4. Analogies for another formats

4.1. PDF

Firefox by default open remote PDF document in built-in viewer.

If in end of link construction #page=$number_of_page, PDF document open in specific page.

I already show example above — open https://d-m.bksdl.xyz/download/book/5c63fa8550b4253978b2a8a6#page=173 in Firefox:

PDF example

4.2. FB2

FB2 Reader Firefox extension:

Install FB2 Reader → paste link http://static.flibusta.is:443/b.fb2/Kazanceva_Corpus_362_V-internete-kto-to-neprav-.AAFbdw.489418.fb2.zip#zz_59 to URL bar → Firefox open a page:

FB2 example

Thanks.

example

Hello,

This looks interesting library. This is not an issue, but a question: is any html example that shows how to open a djvu file which is located on the server? The example with download works fine. But I want view a file which is already located in the same server with djvujs library.

Feature request: hide Contents via configure/constructor

I work with library where most often first page is a map followed by documents, and contents of DjVu document almost always contains 2 links: map and document.

Not only it is quite useless to have content visible but also it takes screen space when looking at map.

I'd like to have setting to turn Contents off and to use more screen space for the document.

thumbnails

Is it possible to create thumbnails with the library? If so, in what way can I achieve it?

Disable "Print" button via config switch

I played with new print functionality. Impressive! But I found that it's often is hell slow and doesn't render our typical documents correctly.

So I'd like to have config switch to disable print button for now till I'll be more confident with the feature.

I will send you examples of my documents later by mail.

Toolbar position at the top ?

Hi Russcoder,
I'm using your library every day and it's very useful , thank you.
Would it be possible to have an option to place the toolbar at the top ( of the image) ?
Currently, the toolbar is under the image.
I always use the zoom function (+ button and -). But when zooming, the toolbar disappears from the screen (following the resizing of the image) and i have to manually use the scrollbar to find it and to reposition the mouse on the + or -...
As I always need to zoom in successively (2~5 times or more), it's not very practical.
If the toolbar was at the top, there would no longer be this matter.
Is it possible to have an option (like DjvuRotation) like this for example:
{ positionToolbar: 0|1 } where 0=normal, 1=top ?
it would be great ;)

Odd/Even page spreads

Thank you for this great tool for in-browser reading of djvu files!

Just a quick suggestion:

It would be good to have an "open book" page spread viewing capability which is very useful for viewing publications with multiple pages displayed on large screens.

Thank you very much indeed for all your hard work.

Feature request: A confirmation message when saving the document

I work with the library (actually libraries) where users have to log in and access to DjVu documents is controlled by the authorization. To put it simply, users pay for the access to these documents and my company doesn't want them to be freely shared.

Examples in the public world: youtube and vimeo doesn't allow you to save their videos. You can watch them at their platform, but not download or share.

So I'd like to show a message to the users downloading (pressing Save) the document reminding them a small portion of the license agreement (e.g. for personal use, but not for public sharing) ("Yes, I agree" is enough) .

В firefox не работает djvu.js версии выше 0.3.5

В chromium 90 работает DjVu.js v.0.5.3, DjVu.js Viewer v.0.8.2. В firefox 88 (и более ранних) просто пустое окно. Последняя версия которая работает у меня - 0.3.5.

Uncaught 
Exception { name: "NS_ERROR_NOT_IMPLEMENTED", message: "", result: 2147500033, filename: "https://ptah-alexs.info/djvu_reader/djvu.js", lineNumber: 13330, columnNumber: 0, data: null, stack: "DjVuScript@https://ptah-alexs.info/djvu_reader/djvu.js:13330:51\nDjVu<@https://ptah-alexs.info/djvu_reader/djvu.js:15534:26\n@https://ptah-alexs.info/djvu_reader/djvu.js:15536:2\n" }
​columnNumber: 0
​data: null
​filename: "https://ptah-alexs.info/djvu_reader/djvu.js"
​lineNumber: 13330
​message: ""
​name: "NS_ERROR_NOT_IMPLEMENTED"
​result: 2147500033
​stack: "DjVuScript@https://ptah-alexs.info/djvu_reader/djvu.js:13330:51\nDjVu<@https://ptah-alexs.info/djvu_reader/djvu.js:15534:26\n@https://ptah-alexs.info/djvu_reader/djvu.js:15536:2\n"
​<prototype>: ExceptionPrototype { toString: toString(), name: Getter, message: Getter, … }
djvu.js:13330
Uncaught Error: There is no DjVu object! You have to include the DjVu.js library first!
    <anonymous> https://ptah-alexs.info/djvu_reader/djvu_viewer.js:2
    n https://ptah-alexs.info/djvu_reader/djvu_viewer.js:2
    <anonymous> https://ptah-alexs.info/djvu_reader/djvu_viewer.js:2
    <anonymous> https://ptah-alexs.info/djvu_reader/djvu_viewer.js:2
djvu_viewer.js:2:206562
Uncaught TypeError: DjVu is undefined
    onload https://ptah-alexs.info/djvu_reader/:21
djvu_reader:21:13

feature_request(sites): LibGen/Z-Library support

1. Summary

It would be nice, if DjVu.js will open remote DjVu files from LibGen and Z-Library like PDF.js opens PDF's from this resources.

2. Note

If you in Russian Federation, АнтиЗапрет or its alternatives may be required for opening links from this issue.

3. Argumentation

Z-Library is the world largest free ebook library. Nowadays (24.11.2019) it contains 4891894 books. Most of thousand books from my collection I was getting from Z-Library. Also, use LibGen search, I can find books in similar big libraries — LibGen, Lib.rus.ec and BookFI.

For details, you can read my instruction about getting free ebooks (in Russian).

4. Steps to reproduce

For example, I want to read Nikolay Zelenevsky's book about dogs anatomy.

I make search request to LibGen → I click, for example, to number 4:

Number 4

Get links → I click to, for example, https://openlib.xyzget item.

  1. Expected behavior — I clicked to PDF link (see image above)
  2. Unexpected behavior — to DjVu link

5. Expected behavior

PDF.js (by default in Firefox):

PDF.js

File successfully opened in browser. Direct links to specific pages as https://d-m.freelib.xyz/get_item/5c63f84150b42539789d0624#page=14 also works.

6. Unexpected behavior

DjVu.js, option Open all .djvu links via the viewer is activated:

DjVu.js

File doesn't open in DjVu.js Viewer.

Thanks.

Error with loadDocumentByUrl

Hi, I'm trying to set up a viewer for djvu files I serve on a local url line /file/uid.djvu. Using the code

 const viewer = new DjVu.Viewer();
 viewer.render(document.getElementById('djvu-view'));
 viewer.loadDocumentByUrl('/file/{{fuid}}.djvu');

but I just get the error:

Unexpected error
{}

What am I doing wrong?

FireFox Problem

Обнаружено, что странички на mk-archive.narod.ru не открываются, так как плагин каминовы на свежий ФФ не ставится. Просьба сделать новый плагин для кода:
<EMBED TYPE="image/x-djvu" SRC="jmk651201.djv" WIDTH="950" HEIGHT="82%"></EMBED>

Сейчас, чтобы открыть странички на mk-archive, пришлось поставить отдельный ФФ 3.6.28.

Установка из npm

Есть ли возможность установки viewer'а из npm?
Хочу использовать в react-приложении на next.js. Там сработала бы оптимизация.
Ещё есть вариант затащить исходники в проект.

Tailwind preflight

При использовании css-фреймворка tailwind внешний вид интерфейса может быть искажен.

image

Предполагается, что tailwind производит сброс стилей по умолчанию, которые затем явно не прописаны в компоненте djvujs.

https://tailwindcss.ru/docs/preflight/

Fullscreen mode

Could you please implement fullscreen reading mode in viewer ?
Difference to "full page mode" would be:

  • switching to fullscreen with Fullscreen API
  • hiding all controls (mainly contents panel and bottom bar with filename)
  • optionally slimmed navigation menu could be displayed, but should also be hiddable
  • gesture navigation would be great (otherwise automatic switching to continuous scroll mode + grab cursor mode would be necessary if navigation menu is hidden)

It should be possible to toggle fullscreen mode or individual panels with buttons on navigation menu and also programatically by config object.

Feature request: don't ignore the parameters.

The search engine https://szukajwslownikach.uw.edu.pl/ uses links in the form
https://szukajwslownikach.uw.edu.pl/redirect/ueHdq/http/djvu.szukajwslownikach.uw.edu.pl/linde/index.djvu%3Fdjvuopts&page=1&zoom=width&showposition=0.187,0.054&highlight=408,2979,73,88
(the redirection was intended for gathering statistics). Your viewer is ignoring the parameters and open always the very first page.

I mean the Firefox extension. The relation to the closed issue #25 is not clear for me.

Print function doesn't work with Safari

Hi RussCoder,

the new print function (Viewer v.0.6.0 - Lib v.0.5.3) doesn't work with Safari 14.0.3 (16610.4.3.1.4) under Mac Os Big Sur (11.2.2 (20D80)). The preview window, printed page as PDF export are blank (tested also with only one page rendered).
It works instead under Chrome on same OS.

Tested with this installation: https://tinyurl.com/jcwtxnws
print_doesnt_work

Feature request: Use file name from Content-Disposition HTTP header if present

Steps to reproduce in development environment, assuming you have built the project).

First set up environment to get djvu files with Content-Disposition headers.
Copy viewer/craco.config.js from r-pankevicius@9a9a422
Now we have an devServer endpoint /djvufile?...arguments... to test different Content-Disposition headers.

To reproduce the issue:

  1. In viewer/src/index.js set initial url to this one:
    window.DjVuViewerInstance.loadDocumentByUrl("/djvufile?fname=%E5%9C%B0%E5%9B%BE.djvu&fntype=1");
  2. cd viewer
  3. npm start -> http://localhost:3000/ will open and display djvu file.

Issues:

  1. Viewer displays file name as djvufile?fname=%E5%9C%B0%E5%9B%BE.djvu&fntype=1 instead of nice file name 地图.djvu.
  2. When pressing save, no file name is present and browser suggests to save file "1" without extension (tried in Chrome). Would be nice to have 地图.djvu as file name to save.

Mousepad scroll fires page change

Hi RussCoder,

I'm experimenting an annoying issue: trying to scroll the page with mousepad (two fingers gesture, up and down), the djvujs viewer intercepts the command and fires the page change. Is there a way to block page this behavior?

Thanks,
A.

Documentation

So if you want to use the library and need the documentation, create an issue on GitHub

Could you provide profound and intelligible documentation, describing API of the DjVu.js library and the viewer, please ?

Rotations possibility ?

Hi,
Thank you for the library, very impressive and useful with new browsers...
Now, I have no issue but a request:
Is it possible to add an optional rotation parameter (values: 0, 90,180,270) to loadDocumentByUrl function ?
Example: loadDocumentByUrl("a.djvu",90) to load and display a.djvu with a 90° rotation.
It would be very helpful.

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.