mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
48.59k stars 9.99k forks source link

Viewer.html is missing in pre-built version pdfs-dist #5609

Closed binishkaspar closed 9 years ago

binishkaspar commented 9 years ago

Viewer.html is missing in pre-built version pdfs-dist https://github.com/mozilla/pdfjs-dist

yurydelendik commented 9 years ago

@binishkaspar it's on purpose. There is a concern that end users mistake Firefox PDF Viewer with custom web site deployment, which will add support load to us. While we temporary package viewer.html in the release package (http://mozilla.github.io/pdf.js/getting_started/#download), we want to make it more customizable, different from demo/Firefox viewer, and simple to use.

We are slowly refactoring the viewer to provide set of embeddable APIs, so custom viewer can be easy deployed on a custom web site, also moving burden of the UI customization on web site developers. See web/pdf_viewer files and examples at https://github.com/mozilla/pdf.js/tree/master/examples/components and #5552

Closing as answered.

binishkaspar commented 9 years ago

@yurydelendik Thanks for the update.

sassanh commented 5 years ago

@yurydelendik I understand your concerns about not liking pdf-viewers on websites look like Firefox's pdf viewer, but can we have it until the "slow refactoring" is done some day?

It took me 2 hours to find out the pdfjs-dist is incomplete I should download that zip file instead just to have that html file. Meanwhile I gave up pdf.js few times and tried to find an alternative because a pdf viewer library that forces you to implement and maintain the code for the pdf toolbar is not a really a pdf viewer library, it's more like a pdf renderer library. I mean there should be an easy way for users to have pdf.js work as a full pdf viewer out of the box (it's there just hidden in that zip file and "purposefully" removed from pdfjs-dist.)

jmle commented 4 years ago

@yurydelendik I understand your concerns about not liking pdf-viewers on websites look like Firefox's pdf viewer, but can we have it until the "slow refactoring" is done some day?

It took me 2 hours to find out the pdfjs-dist is incomplete I should download that zip file instead just to have that html file. Meanwhile I gave up pdf.js few times and tried to find an alternative because a pdf viewer library that forces you to implement and maintain the code for the pdf toolbar is not a really a pdf viewer library, it's more like a pdf renderer library. I mean there should be an easy way for users to have pdf.js work as a full pdf viewer out of the box (it's there just hidden in that zip file and "purposefully" removed from pdfjs-dist.)

Totally agree on this - had the same experience. Also, the documentation doesn't mention this anywhere. At least the FAQ should have an entry for this IMO, clearly stating that the viewer HTML file is not included on the packaged distribution.

ux-engineer commented 4 years ago

Same here, it was frustrating to find this info only now!

Why not make the toolbar configurable, and looking like REALLY basic so that developers would skin it to their likings easily (or leave it be, but looking different than Firefox look)?

Reflic commented 3 years ago

Can only support these people here! I understand that you don't want more support burden but the "slow move" seems to be a very slow move as this issue is already 6 years old now. I would love the idea of @ux-engineer !

And please add an info to the website stating this fact!

evanjmg commented 3 years ago

Please add this - spent 30 minutes just looking for this information - now I need to copy the entire source code over and somehow package it up - and right now the build isn't working. Does anyone have a working npm fork or a way to cleanly bundle this up?

ux-engineer commented 3 years ago

Yes any tips please?! :)

evanjmg commented 3 years ago

Right now, we still need to 'readd' what is implemented in viewer.js - adding the release build directly via webpack gives me errors. I haven't got it working entirely so far I've been following this stackoverflow issue - https://stackoverflow.com/questions/53913361/react-and-pdf-js-changing-page-doesnt-work-when-i-render-whole-document. This works and you'll need to add an eventBus to the controller and viewer config like so const eventBus = new pdfjsViewer.EventBus();. However, this does not give all the functionality of the viewer, all the viewer.js code needs to be copied over.

cepm-nate commented 3 years ago

I don't mind using it as a renderer for thumbnails or within a slideshow, but would really appreciate the viewer.html being included in pdfjs-dist for the times when I DON'T want to re-create an entire viewer. Mozilla, if you don't want users to confuse the viewer within Firefox with the viewer as it is used in other apps, then I second the suggestion to make a theme change in either the one in Firefox, or the one that is built in pdfjs-dist. Something as simple as the background color of the toolbar might do the trick.

stevenjoezhang commented 3 years ago

I wrote a GitHub Actions script to automate the building process: https://github.com/next-theme/theme-next-pdf/blob/main/.github/workflows/update.yml

jcompagner commented 1 year ago

who can really explain the logic to me for this? i just don't get it so i want to just use it through npm packages which is nice and easy to use for example in modern app dev (like angular) But then i don't have the viewer.hml that i can embed in an url

but the distribution zip download from here: https://github.com/mozilla/pdf.js/releases/download/v3.8.162/pdfjs-3.8.162-dist.zip has it just fine, so anybody who wants to use the viewer will then just use that one, so the end result is the same right?

" There is a concern that end users mistake Firefox PDF Viewer with custom web site deployment, which will add support load to us. "

So many did make all kind of support claims??

So currently the only way todo this is to copy it in your own stuff and then use it, but that is effectively exactly the same...

"While we temporary package viewer.html in the release package"

so 8 years is temp?