RyotaUshio / obsidian-pdf-plus

The most Obsidian-native PDF annotation, viewing & editing tool ever. Comes with optional Vim keybindings.
https://ryotaushio.github.io/obsidian-pdf-plus/
MIT License
712 stars 15 forks source link

[FR] Zoom around centre of page (rather than edge) and retain horizontal position when jumping pages #180

Open jakecb123 opened 5 months ago

jakecb123 commented 5 months ago

Describe your request

Hello, thank you very much for the great plugin,

Is it possible to have a (toggle-able?) setting so that the zoom level is based on the centre of the page (middle of the page horizontally)? As in, setting 150% would equally cut off the same amount of the page on the left and the right (whereas right now only the right side is cut off). This would be very helpful as many of the documents I view have large margins, and screen real-estate is precious when splitting in obsidian - it would mean I can increase the default zoom level and not have to pan horizontally each time.

Also, I have noticed (at least when using vim keybindings) that moving pages (pressing keys, not scrolling), resets the vertical scroll position (snaps back to the left as when entering a zoom value) making using keys to move pages impractical when zoomed in.

If you could find time to look into this, that would be great.

RyotaUshio commented 5 months ago

Thanks for the suggestions.

As for the first point (zoom around centre of page), I'm not sure if pdf.js (the underlying PDF viewer library) provides that functionality or not. But I agree it would be very useful so I'll look into it when I have time.

About the second point, probably it's something I can fix so I'll address it in the near future.