Skip to content
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

Support for Multiple PDF viewers on the same page (e.g. tabs) #196

Closed
ishanuda opened this issue Jan 24, 2020 · 5 comments
Closed

Support for Multiple PDF viewers on the same page (e.g. tabs) #196

ishanuda opened this issue Jan 24, 2020 · 5 comments
Assignees
Labels
considering it Maybe I'll implement this, maybe not. I haven't made up my mind yet. It's an interesting proposal! enhancement New feature or request I'd like to help but it's difficult You've raised an issue that's just right - but for some reason, it's hard to solve.

Comments

@ishanuda
Copy link

Hi,
I would like to know any plan to implement the Multiple PDF viewers on the same page (e.g. tabs) for the amazing library.

Thank you very much.

@stephanrauh
Copy link
Owner

I wouldn't call it a plan - it's more like an idea. Maybe - just maybe! - a future version of ngx-extended-pdf-viewer is going to support displaying multiple PDF file simultaneously.

The idea of ngx-extended-pdf-viewer is to offer a tight, SEO-friendly integration of Mozilla's pdf.js project into your application. That means two things:

  • I don't want to modify pdf.js much. If I do, the next update is going to break my changes. (It already did!). So, replacing the global variables of pdf.js by something allowing for multiple PDF viewers - well, that's out of scope. It can be done, but I can't do it in my limited spare time. Adding insult to injury, the pdf.js team won't do it because their primary goal is to write a PDF viewer for Firefox.
  • I don't want to use iFrames.

However, I'm thinking about allowing iFrames as an option. By default, there's no iFrame. That's important, because I want my library to be Google-friendly.

But if you insist, you can activate iFrames, allowing you to display multiple PDF viewers simultaneously and independently. There's a SEO penalty, but as long as you know what you're doing, that's fine by me. Most inhouse applications aren't indexed by Google, so who am I to complain?

I'm not sure how much work that is, and if I'm going to manage it, but I'm positive I can do it in reasonable time. It's just not on my priority list, so it may take a couple of months before I start investigating the topic more thoroughly.

In the meantime, you can speed up the process by providing a pull request. Are you interested?

@stephanrauh stephanrauh self-assigned this Jan 24, 2020
@stephanrauh stephanrauh added enhancement New feature or request considering it Maybe I'll implement this, maybe not. I haven't made up my mind yet. It's an interesting proposal! labels Jan 24, 2020
@ishanuda
Copy link
Author

ishanuda commented Jan 25, 2020

Hi,
Thank you for the quick reply,

As for the request,
I did some research about the PDF.js related to the topic and found some interesting discussions.

mozilla/pdf.js#5148
mozilla/pdf.js#5442
mozilla/pdf.js#6571

Would like to contribute to your amazing work, still, need to dig into the code, Could I be able to fork the repo and do some experiments first?

regards.

@stephanrauh
Copy link
Owner

Oh, sorry, it seem I've missed the second part of your question. Sure, pull requests are always welcome. Feel free to fork the repo. Actually, you need to do this to send me a pull request. :)

Best regards,
Stephan

@stephanrauh
Copy link
Owner

The discussion you've found mostly deal with the rendering engine (pdf.js and pdf.worker.js). The challenge is to teach the viewer.js file not to use global variables.

@stephanrauh
Copy link
Owner

I've tried to move the PDF viewer to an iFrame a couple of days ago. No go. If you need multiple PDF viewers on the same file, I recommend using https://www.npmjs.com/package/ng2-pdf-viewer. That's another fine library. The difference to my library is it put the PDF viewer into an iFrame from day one. That enables them to display multiple PDF file simultaneously.

@stephanrauh stephanrauh added the I'd like to help but it's difficult You've raised an issue that's just right - but for some reason, it's hard to solve. label Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
considering it Maybe I'll implement this, maybe not. I haven't made up my mind yet. It's an interesting proposal! enhancement New feature or request I'd like to help but it's difficult You've raised an issue that's just right - but for some reason, it's hard to solve.
Projects
None yet
Development

No branches or pull requests

2 participants