farling42 / fvtt-pdf-pager

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

[Bug] Page navigation doesn't work correctly #45

Closed delegreg closed 1 year ago

delegreg commented 1 year ago

Steps to reproduce :

1-Create journal entry 2-Create first page, using "dummy.pdf", set PageOffset 3 3-Create second page, using same "dummy.pdf", set PageOffset 10 4-Try activating first then second page, then go back to first, the PDF opens correctly, but page navigation doesn't work (file is opened at the last reading position)

This is a hindrance in my use-case (single pdf containing a whole scanned scenario, journal pages are defined to quickly access several locations or monsters/npcs inside the file)

farling42 commented 1 year ago

Your steps sound like the issue is with the core support for PDFs within Foundry v10, rather than a bug in the extra support that my module provides.

Have you tried using the table of contents that this module provides to navigate within a single PDF document?

farling42 commented 1 year ago

Another alternative is to create a normal text journal page containing all your links to specific positions within the PDF, then clicking on those links will move the open PDF to the relevant page/section. Note that you can create links to sections within a PDF by dragging from the table of contents (if it exists in the PDF as an outline).

delegreg commented 1 year ago

Example PDF is an old scanned module, no toc included, but the workflow you proposed (using a text page as a toc) should work. Thanks for that.

Still seems unintended behavior that a journal page set to open dummy.pdf at PageOffset 10 would open said file at page 3 if the file was previously opened at that page.

delegreg commented 1 year ago

Updated original issue and latest comment to highlight the PageOffset use, hope it helps.

farling42 commented 1 year ago

The page offset in the PDF Pager settings is only used when using @UUID[uuid#page=xx] or @PDF[name|page=xx] as part of a link to open the PDF. The "xx" after the page is added to the page offset defined for the PDF in order to calculate the correct page within the PDF document itself.

The PDF browser provided in Foundry v10 always seems to open a PDF at its last opened page if you just open the PDF journal page without using a link that contains a specific section or page number.

delegreg commented 1 year ago

My bad, just a misunderstanding on my part