izuzak / atom-pdf-view

Support for viewing PDF files in Atom.
https://atom.io/packages/pdf-view
MIT License
106 stars 30 forks source link

Embedded PDF images vanish #69

Closed lu-kas closed 8 years ago

lu-kas commented 9 years ago

Hey!

OS: OSX 10.10.5 atom: 1.0.7 pdf-view: 0.23.0

I am using atom to preview a (latex generated) PDF file. Everything is fine, however figures vanish, reappear or are distorted when I change the zoom. Some figures newer show themselves. The PDF document itself is fine, as preview and other PDF viewer show the correct contents.

The attached screenshot demonstrates this, left atom pdf-view, right OSX-preview, both for the same document.

Thanks, Lukas

test-pdf

izuzak commented 9 years ago

Huh, that's interesting -- thanks for the report. Not really sure what in pdf-view might cause this. This package uses pdf.js for rendering PDFs -- have you tried reproducing the problem with pdf.js?

Also, can you share a pdf for which this is happening?

Does this happen when the PDF is re-generated from latex (i.e. the PDF changed while you were looking at it) or can it happen when the PDF is not changing also?

What do you normally do to fix things when this happens? Does zooming-unzooming help?

lu-kas commented 9 years ago

0) A test pdf is attached, it is a different one as the one from the screenshots, but shows the same issues. Due to file name restrictions in this forum it has an png extension, just remove that.

1) I did a few tests with pdf.js and saw no issues with the attached pdf. In combination with atom, the viewing of the attached pdf resulted in a vanishing embedded image, while chaning the zoom. I should note, that I am not an expert on pdf.js.

2) see 0)

3) it is independent of the latex recreation process, it also happens with a 'static' pdf

4) well, I basically do nothing to fix it, as I spent most of the time with texting. Yes, zooming might help, as it might get in a state where the images are shown as intended.

Thanks for any support!

test pdf

izuzak commented 9 years ago

Thanks for clarifying. That PDF you uploaded doesn't seem to be available anymore, but I think I know what you're saying. I've observed this as well when zooming a complex page several times very quickly -- it's as if the re-renderings of the page for different zoom-levels get mixed up or something.

Definitely sounds like something that should be fixed in this package, since pdf.js doesn't have that problem. I probably won't have time to dig into this in the near future, so if someone else wants to contribute a patch for this -- I'd be happy to review and merge.

One thing I've observed is that zooming slowly helps prevent this from happening. So, instead of pressing cmd + or cmd - very quickly two or three times, I just press it once, and then once again after the the previous zoom completed.

lu-kas commented 9 years ago

I do observe the issue also while very slowly changing the zoom level, actually in some pdf a few (pdf-)images never show.

Just in case, that I find some time to look into it. Where should one start looking?

izuzak commented 9 years ago

I do observe the issue also while very slowly changing the zoom level, actually in some pdf a few (pdf-)images never show.

Whoa, that's interesting. Can you email me one such pdf? izuzak@gmail.com

Just in case, that I find some time to look into it. Where should one start looking?

Not really sure, to be honest. I guess I'd start looking at the code which controls zooming and PDF rendering.

lu-kas commented 9 years ago

I can not send you any of the PDF I mentioned, as they are confidential. However, I will prepare a similar, yet simple document.

lu-kas commented 8 years ago

Hi again!

1) I would like to thank you for providing this package! 2) There seem to be many users of this package, who also use it in combination with latex generated pdfs, but its only me that has this rendering issues. Therefore I think, that this is just my personal issue and is probably not work further digging. I will close this issue, however if others observe similar problems, it may be reopened ...

Thanks!

izuzak commented 8 years ago

Thanks for following up, @lu-kas. :heart: Yeah, if anyone else runs into problems like these -- please let me know, I'd love to be able to reproduce them.