Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fit width mode for variable page sizes #447

Open
sebastinas opened this issue Feb 6, 2024 · 12 comments
Open

Fit width mode for variable page sizes #447

sebastinas opened this issue Feb 6, 2024 · 12 comments

Comments

@sebastinas
Copy link
Member

On GitLab by @helixoid on Feb 6, 2024, 06:46


I have some books (especially One Piece Manga) which has variable page sizes(several portrait and some landscape/dual-page-spreads) and when I press "s" it adjusts the document according to the width of page in landscape mode, at least it did before not now because of the page cropping issue.

I want it to adjust the document fit on per page basis like how Okular does.

I really love this program and not really a fan of all the kde dependencies that come with okular.

I also don't know how make zathura prevent scrolling to the next page when using mouse or touchpad one solution could be to display one page at a time and one change the page when pressed pagedown key and not the mouse scroll wheel.

And manga pages(dual-page-spreads) with different page sizes and getting cropped and some of the information is not displayed.

@defect1ve
Copy link

Today I faced this same problem and tracked it back to this issue and corresponding commit.

Reverting the changes made in that commit makes Zathura able to render different sized pages correctly again, but reinstates the issues originally reported (inconsistent page padding in some pages and fit commands fitting to largest image in the document).

Not sure what the course of action should be but personally I'd like Zathura to go back on that change and be able to render pages of different sizes without cropping. Maybe we could find other ways to fix the issues in the initial report.

Here's a before and after of reverting the change:

zathura 0.5.4
screen-2024-05-12T22:03:53+0200

zathura 0.5.6 reverting the changes from that commit
screen-2024-05-12T22:03:29+0200

@devensiv
Copy link

related to #436

Im still having this issue using 0.5.6 (OS Arch Linux)
zathura --version

zathura 0.5.6
girara 0.4.4 (runtime: 0.4.4)
(plugin) pdf-poppler (0.3.2) (/usr/lib/zathura/libpdf-poppler.so)

my current workaround is downgrading to
zathura --version

zathura 0.5.2
girara 0.3.9 (runtime: 0.3.9)
(plugin) pdf-poppler (0.3.1) (/usr/lib/zathura/libpdf-poppler.so)

@agguser
Copy link

agguser commented Jun 4, 2024

For now, please revert the code so that it displays full (instead of cropped) variable sized pages! Or add a "mode" (specified using a command-line option or a key binding) that uses old-behaviour rendering.

A solution might be that each page has its own scale (retaining page's aspect ratio) to make all pages have the same width, resulting in no gaps between pages.

9ary added a commit to 9ary/zathura that referenced this issue Jul 7, 2024
@9ary
Copy link
Contributor

9ary commented Jul 7, 2024

The aforementioned commit does indeed break documents with mixed page sizes completely.

Before (zathura 0.5.6 with the faulty commit reverted):
image
image

After (zathura 0.5.6, no patches):
image
image

GNOME Papers 46:
image
image

Sample document: https://www.st.com/resource/en/datasheet/stm32h743vi.pdf

As you can see, the only differences between Papers and zathura's old behavior are:

  • positioning of the page within its tile/cell
  • dynamic cell height

Otherwise, Papers renders all pages at the same scale, within in the same cell width, and all automatic zoom modes ("fit page", "fit width", "automatic") account for the largest bounding box, both in single and dual page modes.

In light of all of this, I concur with agguser: the change should be reverted, and the behavior can be refined from there to match other readers.
There seems to be some confusion between this issue and #436, so going back to OP's request, this is a matter of letting auto-adjust modes adapt dynamically to the current page's dimensions, and/or adding an option to render pages with variable scale.

Edit: Okular's fit modes render pages with mixed scales.
image
image
image

@0re5ama
Copy link

0re5ama commented Sep 4, 2024

I am getting this issue on 0.5.8

@Felipe-9
Copy link

Felipe-9 commented Nov 23, 2024

I would really appreciate to have this fixed, there is more gaps than pages on my pdfs xD

Screenshot 2024-11-23 at 17 40 00

@Br31zh
Copy link

Br31zh commented Dec 17, 2024

I have a similar problem with webcomics that are meant to be read with no gaps. I use set page-padding 0 and it’s ok for most of it, but some pages have a different height and then it’s hard to read.

2024-12-17-120720_510x922_scrot

I searched and found a lot of closed issues and commits about the varying page size problem including some in August and December, but still have it on the last version:

$ zathura --version
zathura 0.5.10
girara 0.4.5 (runtime: 0.4.5)
(plugin) djvu (0.2.10) (/usr/lib/zathura/libdjvu.so)
(plugin) ps (0.2.8) (/usr/lib/zathura/libps.so)
(plugin) pdf-poppler (0.3.3) (/usr/lib/zathura/libpdf-poppler.so)
(plugin) cb (0.1.11) (/usr/lib/zathura/libcb.so)

So is this issue (while being older) still the one to follow for this problem?

@Juliaria08
Copy link

Any update?, I'm still seeing the issue when loading a PDF with a few pages that are rather large (like it's a A4 PDF with a few images that are huge (relatively), thus zathura renders the A4 pages too small to be seen, if this is not the issue to comment this on please tell me and I can make another one.

@ldwgchen
Copy link
Contributor

ldwgchen commented Feb 2, 2025

Any update?, I'm still seeing the issue when loading a PDF with a few pages that are rather large (like it's a A4 PDF with a few images that are huge (relatively), thus zathura renders the A4 pages too small to be seen, if this is not the issue to comment this on please tell me and I can make another one.

This issue ought to be the cause.

@helixoid
Copy link

helixoid commented Feb 8, 2025

Maybe while fixing this issue we should also enhance Zathura with #724

@ldwgchen
Copy link
Contributor

ldwgchen commented Feb 8, 2025

Maybe while fixing this issue we should also enhance Zathura with #724

This issue is a duplicate.

@ldwgchen
Copy link
Contributor

ldwgchen commented Feb 9, 2025

Image

I'm working on a solution right now. Seems promising!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests