farling42 / fvtt-pdf-pager

PDF Pager for Foundry
MIT License
6 stars 4 forks source link

[Bug] blinking pdf #42

Closed brunocalado closed 1 year ago

brunocalado commented 1 year ago

Hi,

When I open a pdf it start to blink.

https://user-images.githubusercontent.com/4999783/205438589-b54451b6-5251-46ab-86d2-d72e5c2c8929.mp4

farling42 commented 1 year ago

Hi, I would expect it to blink once when you open a PDF for the first time, because it is generating a table of contents.

Would it be possible for you to provide a copy of the PDF to me so that I can do some more thorough debugging?

brunocalado commented 1 year ago

This happen with all PDFs. But, I'll send a bug one. CheatSheet.pdf

farling42 commented 1 year ago

I just tried the PDF and it seems to be working properly in my installation.

What browser are you using (and version), and what operating system?

Looking in the browser console, I'm seeing a lot of warnings about some data in the PDF header:

Warning: Unsupported header type 1885564018 (pclr).
pdf.worker.js:1111 Warning: Unsupported header type 1668112752 (cmap).

Did you create the PDF yourself? Do you know what tool created it?

farling42 commented 1 year ago

One last question. Does the PDF display properly if you disable the "PDF Pager" module? (When you will have to press the LOAD PDF button)

brunocalado commented 1 year ago

One last question. Does the PDF display properly if you disable the "PDF Pager" module? (When you will have to press the LOAD PDF button)

Yes. It work well without pager.

brunocalado commented 1 year ago

I just tried the PDF and it seems to be working properly in my installation.

What browser are you using (and version), and what operating system?

Looking in the browser console, I'm seeing a lot of warnings about some data in the PDF header:

Warning: Unsupported header type 1885564018 (pclr).
pdf.worker.js:1111 Warning: Unsupported header type 1668112752 (cmap).

Did you create the PDF yourself? Do you know what tool created it?

Windows 10 Google Chrome 108.0.5359.95 (oficial) 64 bits and Firefox 107.0.1 (64-bits) System: SWADE Module list: image

brunocalado commented 1 year ago

I tried Find the Culprit image

farling42 commented 1 year ago

Unfortunately libWrapper is unlikely to actually cause the error - it is more likely several modules which use that library are affecting each other.

I tried loading up most of the modules in your list, and I get a swirling circle for longer with the following modules enabled: image

farling42 commented 1 year ago

Can you try disabling custom CSS? I don't know what changes the CSS might be making to the PDF pages.

I'm not certain about the "PDF ..." message in the console of your video. In my browser it says: image So I don't know if you have an older version of the PDF being used.

Mine says PDF version 1.7 and a PDF producer of CC 2019. Yours says PDF version 1.4 and a PDF Producer of Adobe InDesign 14.0 (You can see this information if you load the PDF into Adobe Acrobat Reader, and look at the Document Properties from the FIle menu).

delegreg commented 1 year ago

I had the same thing. Steps to reproduce :

1-new world 2-create pdf journal page 3-install pdfpager module 4-try to open journal page 5-blink happens 6-edit page, save 7-doesn't blink anymore

IMHO it comes down to having a pdf PageOffset stored with your journal page entry

farling42 commented 1 year ago

I would expect it to blink once when you set up a new PDF, because it calculate the journal's table of contents from the Outline inside the PDF (which causes the page to reload when the table of contents is displayed). But after that there shouldn't be a continuous blinking.

brunocalado commented 1 year ago

I had the same thing. Steps to reproduce :

1-new world 2-create pdf journal page 3-install pdfpager module 4-try to open journal page 5-blink happens 6-edit page, save 7-doesn't blink anymore

IMHO it comes down to having a pdf PageOffset stored with your journal page entry

This stops the blink. But, I have several worlds with lots of PDFs. Is it possible to fix this?

https://user-images.githubusercontent.com/4999783/208421317-9763c004-40e6-48d7-a222-7ade99235aaa.mp4

farling42 commented 1 year ago

I had the same thing. Steps to reproduce :

1-new world 2-create pdf journal page 3-install pdfpager module 4-try to open journal page 5-blink happens 6-edit page, save 7-doesn't blink anymore

IMHO it comes down to having a pdf PageOffset stored with your journal page entry

When these specific steps are used with a PDF without an outline, and the PDF page has not already been loaded at least once, then the above steps were enough to cause the constant reloading.

Version 0.36.2 should fix this problem (although it seems like a lower level lack of optimisation that really caused the problem - unsetFlag caused the page to load, even if the flag never existed on the document).