-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use viewer in atom package #11358
Comments
The contents of the
The mentions of SystemJS would suggest, at least to me, that you attempted to use the code as-is without actually building it first (using e.g. |
I'm afraid building a custom viewer is a bit beyond my abilities, at least for the moment. Moreover, examples only get you so far if the API exposed by Is there a problem with me using
As far as I understand, pdfjs-dist contains a pre-built version. I got it working for now by a combination of scraping from I ended up with the files
Is this actually everything I (could possibly) need? The two directories contain many more files... It would be great if you could tell me which files exactly I would have to include from the repository in my code to be sure everything works. |
The problem is when you're using pre-built files, e.g. from the pdfjs-dist repository, together with the raw files directly from this repository; that will simply not work well.
But #11358 (comment) already did mention simply using releases from /~https://github.com/mozilla/pdf.js/releases since they should contain everything that you need here :-) |
I'd rather not build myself, and the releases aren't pre-built, are they? At least /~https://github.com/mozilla/pdf.js/wiki/Setup-pdf.js-in-a-website#pre-built-pdfjs refers only to pdfjs-dist. Another advantage of pdfjs-dist is that I can make it a dependency of my Atom package, so people using my package would have it installed automatically. The disadvantage of pdfjs-dist is that it doesn't include |
Of course they are, which is exactly why I suggested that you use them! |
I agree with the comments above, in particular #11358 (comment) should give you all that's necessary to work with. If there are clear things we can improve in the distributions, please open a dedicated issue for them. |
@timvandermeij, I think /~https://github.com/mozilla/pdf.js/wiki/Setup-pdf.js-in-a-website#pre-built-pdfjs is misleading, because it only mentions pdfjs-dist as a source for a prebuilt version, but does not mention the pdf.js releases. OK, the release download files are also called "pdfjs-dist", but one doesn't know that unless one looks there, so the misunderstanding that this is only about the pdfjs-dist repository & derived npm package is easy. If you like, I can open a new issue for that. |
@allefeld I think this is a good point. I have updated the page at /~https://github.com/mozilla/pdf.js/wiki/Setup-PDF.js-in-a-website to also list the official releases. Thank you for your feedback! |
Thanks, the added text looks good! |
I'm developing an Atom package including a PDF viewer, and I'm trying to do that based on pdf.js. My package inserts an
iframe
into its view, and loadsviewer.html
into it.As a first test, I loaded
https://mozilla.github.io/pdf.js/web/viewer.html
into theiframe
, and that worked perfectly, both with the hardlinked pdf and with local files.But I don't want to depend on Internet access, so I made my package depend on pdfjs-dist.
First problem: Unlike pdf.js, pdfjs-dist does not contain
viewer.html
underweb/
. I've read the remarkand that that is the reason not to include it, but I honestly intend to reskin the viewer, that in itself is not a reason not to include it. Moreover, if that's the reason, then the viewer JavaScript and CSS should not be included either.
My solution was to download
viewer.html
from pdf.js. I had to adjust some paths in the HTML, and add a dependency on systemjs, and downloadsystemjs.config.js
.Unfortunately, now I've run into a second problem I don't know how to fix:
Can you tell me how to fix this?
Or, is there something fundamentally wrong in how I approach this?
Configuration:
The text was updated successfully, but these errors were encountered: