You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 (check window.location.protocol) I don't know how to get around this problem (I've tried quite some things 😕), but with atom-pdf-viewyou 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 and atom.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 it renderPdf) 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 👍
The text was updated successfully, but these errors were encountered:
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. 😉
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
👍The text was updated successfully, but these errors were encountered: