sumatrapdfreader / sumatrapdf

SumatraPDF reader
http://www.sumatrapdfreader.org
GNU General Public License v3.0
13.37k stars 1.7k forks source link

Fails with some EPUB3 files - possibly Fixed-Layout or background images #1293

Open sam896 opened 4 years ago

sam896 commented 4 years ago

I've just tried Sumatra on several version 3 epubs, and they all failed to place text correctly.

Changing UseFixedPageUI = false to true in EbookUI in the settings files changes the way in which it fails, but they were all wrong. The text was placed on a separate page, or places underneath images. At a guess it's problems with placing text on background images, or with fixed layouts that specify where text needs to go.

An example of a file that fails is https://www.blacklibrary.com/Downloads/Product/ePub and MOBI Extracts/E/Exterminatus-Preview.epub

GitHubRulesOK commented 4 years ago

What you are seeing in Epub2 interface is the effects of "Reflow" which is not suited to irregular shaped images that may work better in a comic book format (which generally does not support text !) Epub3 features (including Audio/Video media etc.) are not currently supported by the MuPDF engine that SumatraPDF uses and my preference is to use the FixedUI for AZW3 and Epub3 unfortunatly FB3 is not viewable. @kjk I sugest this is consolidated with #849

sam896 commented 4 years ago

Ah, I wasn't aware that I was using an Epub2-specific interface.

Nothing I'd seen in the manual mentioned something like that, and the information on supported formats listed epub generally rather than stating it only supported some particular version. In the short term I'd suggest the manual mention that only some version of epub are supported, and possibly explain about those interfaces you mention. Even looking now I know the term I can't spot anything about interfaces. I can't currently make sense of what you write about FB3 or FixedUI for AZW3, or how whatever it is might help me here.

It would of course be nice if these sorts of documents could be supported, but I realise it would be a lot of work for whoever's involved.

GitHubRulesOK commented 4 years ago

@sam896 SumatraPDF was written when there was only epub (and version 1 mobi ) It works with modern epub2 reasonably well but the latest version 3 formats add multimedia and other HTML5 scripted features that require a significantly new approach similar to web browsers

sam896 commented 4 years ago

Understood. I suggest whoever does such things (Mr Kowalczyk himself?) changes https://www.sumatrapdfreader.org/docs/Supported-document-formats.html to say it only supports versions 1 and 2 of epub.

It might also help if the reader itself would report when it's asked to open a version it can't manage properly. The example I gave is quite easy to tell, but other documents might be wrong without whoever's opened it realising, or people might be left thinking they've got a faulty document rather than just one made in an unsuitable version.

GitHubRulesOK commented 3 years ago

1293 Exterminatus-Preview.epub.zip @kjk The above OP linked DRM sample (renamed to .zip for upload) appears to be a regression in current pre-release as it was opened in some previous versions MuPDF 1.18 states its DRM protected

kjk commented 3 years ago

The file has encryption.xml file which lists encrypted files. In this case it's just a font file that is encrypted.

Our renderer would ignore encrypted files. mupdf just rejects files with encryption.xml. The check can be disabled in epub_parse_header but this particular file renders really badly in mupdf.

Pocokk commented 1 year ago

Apologize for the necro, but how can I disable it in "epub_parse_header "? Where can I make that switch?

GitHubRulesOK commented 1 year ago

@Pocokk that would be in the core MuPDF source so would be a "deviation" needing repeated handling see https://github.com/sumatrapdfreader/sumatrapdf/blob/9a2183db3c3db5cbf242ac9d8f8576750f581096/mupdf/source/html/epub-doc.c#L686