You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EPUB: blank page before and after the cover since MuPDF 1.28.6 (PyMuPDF 2.x) #5246
Laying out an EPUB and converting it to PDF adds an empty page before and an empty page after the cover image with PyMuPDF 2.1 (MuPDF 1.28.6). PyMuPDF 1.28.2 (MuPDF 1.28.2) and 1.27.2.3 (MuPDF 1.27.2) give the cover on page 1 and no empty page. We also see it with 2.0 on Linux.
Project Gutenberg #4650 (Candide, EPUB 2 with images): 66 pages with 1.27.2.3 and 1.28.2, 68 pages with 2.1. Pages 1 and 3 have no text and no image, page 2 holds the cover.
This report should actually be targeted directly to MuPDF's issue system https://bugs.ghostscript.com/enter_bug.cgi because pymupdf cannot do anything about the problem.
You could easily argue that the MuPDF viewer displays these 2 empty pages with its current version (confirmed), while older versions do not misbehave.
Thanks, filed upstream as https://bugs.ghostscript.com/show_bug.cgi?id=709957.
It comes from MuPDF commit 9da4f600b5 (Bug 709663): an image taller than the page is now scaled to the full page height and ignores the body margin, so it no longer fits and gets pushed to the next page. A three-line HTML file with body { margin: 0.5em } reproduces it.
Fine to close here.
We usually, in an effort to maintain a complete test suite, we also test MuPDF fixes when created in response to a PyMuPDF issue ... like yours.
I think I will create a test script that does the following:
Before putting it in our test suite, the respective fix of 709957 must be part of the MuPDF version that becomes part of PyMuPDF.
Only once this PyMuPDF version becomes available on PyPI, the issue will be closed here.
Activity
JorjMcKie commentedon Nov 4, 2026
This report should actually be targeted directly to MuPDF's issue system https://bugs.ghostscript.com/enter_bug.cgi because pymupdf cannot do anything about the problem.
You could easily argue that the MuPDF viewer displays these 2 empty pages with its current version (confirmed), while older versions do not misbehave.
Jamalofski commentedon Nov 4, 2026
Thanks, filed upstream as https://bugs.ghostscript.com/show_bug.cgi?id=709957.
It comes from MuPDF commit 9da4f600b5 (Bug 709663): an image taller than the page is now scaled to the full page height and ignores the body margin, so it no longer fits and gets pushed to the next page. A three-line HTML file with
body { margin: 0.5em }reproduces it.Fine to close here.
JorjMcKie commentedon Nov 4, 2026
We usually, in an effort to maintain a complete test suite, we also test MuPDF fixes when created in response to a PyMuPDF issue ... like yours.
I think I will create a test script that does the following:
Before putting it in our test suite, the respective fix of 709957 must be part of the MuPDF version that becomes part of PyMuPDF.
Only once this PyMuPDF version becomes available on PyPI, the issue will be closed here.