Open jneuendorf opened 5 years ago
Thanks for opening an issue for this, @jneuendorf! π Yeah, I think that would be a really really nice feature. That said, I have no idea how much work that would involve. My package uses PDF.js and it somehow just works π. I won't pretend I understand how and why it works -- but it does.
And even if I knew how much work it involved -- I probably won't have time to do the work myself anytime soon.
With that in mind -- if you'd like to take a crack at this, please feel free! I'd be happy to review a pull request and help with testing π
Hey @izuzak, thanks for your comment. I would try to look into it but it will probably take some time as I am busy as well. It would be nice to know there are no major changes coming soon, because my changes require some refactoring. π
I would try to look into it but it will probably take some time as I am busy as well.
π More time is on my shopping list as well. π¬
It would be nice to know there are no major changes coming soon, because my changes require some refactoring. π
I'm not going to make any major changes -- I'm not actively working on this package, just doing maintenance as needed (again, due to lack of time).
Hey,
Preamble
I am working on a package where I wan't to display local PDF files -- just like
atom-pdf-view
. Since I am using React in my package, I figured I'd use react-pdf but I couldn't get it to work...I assume it has something to do with a warning I got (Loading PDF as base64 strings/URLs might not work on protocols other than HTTP/HTTPS. On Google Chrome, you can use --allow-file-access-from-files flag
). Since Atom uses the file protocol (checkwindow.location.protocol
) I don't know how to get around this problem (I've tried quite some things π), but withatom-pdf-view
you somehow do get it to work π.So now, I am trying to just indirectly use your package by using Atom's URI opener feature (see
atom.workspace.open
andatom.workspace.addOpener
).Features Request
For me, it would be really cool if I could use your packages core to display PDFs wherever I want (in the DOM).
My current idea is to have a service provided by
atom-pdf-view
that other packages can consume. The consumer would get an async function (let's call itrenderPdf
) that takes a file path or data URI und returns an element (<canvas>
I believe but not sure) that contains the rendered PDF.I am not familiar how updating/scaling works, thus there may be some more options needed to pass onto
renderPdf
, i.e. the wanted width.This feature would make your code for displaying PDFs in Atom independent from Atom's file/URI handling and I think this is really nice and powerful. Let me know what you think π
PS: Thanks for
atom-pdf-view
π