stephanrauh / ngx-extended-pdf-viewer

A full-blown PDF viewer for Angular 16, 17, and beyond
https://pdfviewer.net
Apache License 2.0
474 stars 181 forks source link

Pdf view blocked when we open more than one at the same time #2396

Open Gabrielle-anne opened 3 months ago

Gabrielle-anne commented 3 months ago

Discussed in https://github.com/stephanrauh/ngx-extended-pdf-viewer/discussions/2335

Hello, I opened an issue because the discussion was somehow labeled as solved, But it still doesn’t work, and I don’t know how to put it back in unsolved. I can’t change the pages on the second pdf without reloading, but on the first one all is working perfectly. The bug appears when I do this :

openPdf() {
window.open('/pdf', '_blank')
window.open('/pdf', '_blank')
window.open('/pdf', '_blank')
}

I tried this : test 4.zip Is there something I did wrong ?

Thank you very much, for your help.

stephanrauh commented 3 months ago

Yes, I remember your message, and it's still in my inbox. Sorry about answering sluggishly - currently I'm drowing in a flood of tickets, and some of them are very convoluted.

I've marked your discussion as solved because I'd managed to reproduce the issue, and after that, I'd managed to solve that. Now I wonder if there's a difference between your project and my project. Or if there's something else going on.

Gabrielle-anne commented 3 months ago

Hello, I've managed in zip I sent in my message, to reproduce the problem each time no matter what. Are you sure you can move as you please on the second PDF without reloading ? I use Angular 15.1 and the version of the library I use is the 18.1.10 Thank you for your time,

stephanrauh commented 3 months ago

I've downloaded your test.4.zip and got it up and running. I can navigate between the pages without problems, no matter how many tabs I open or which one I try. The problem was about page navigation, right?

Gabrielle-anne commented 2 months ago

Hello, I am very surprised that you didn't reproduce this bug, I tried on 2 computers and on other navigators and it's always showing up. So I desperately searched on my own, and then I found this : image

When the bug shows up : the location is filled (location.pageNumber =1 and we can't navigate on the pdf). I think it's because the program go systematically back on the first page. When it's working fine, the location is null.

stephanrauh commented 2 months ago

That's remarkably strange. What is the location, and why does it interfere here? Maybe it's a timing problem. The location is set to the first visible page here, and maybe this method is called too early and that's why why navigation is broken:

image
stephanrauh commented 1 month ago

Can you test your application with version 21.1.0 again, please?