mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
PDF Output: Fix incorrect rendering of html files with only a single large image and very little text. In some rare circumstances, the full html file would not be rendered. Fixes #1278877 [conversation EPUB to PDF - Error](https://bugs.launchpad.net/calibre/+bug/1278877)
This commit is contained in:
parent
9b39984aab
commit
c0e9d14ba1
Binary file not shown.
@ -176,7 +176,11 @@ class PagedDisplay
|
|||||||
# with height=100% overflow the first column
|
# with height=100% overflow the first column
|
||||||
has_svg = document.getElementsByTagName('svg').length > 0
|
has_svg = document.getElementsByTagName('svg').length > 0
|
||||||
only_img = document.getElementsByTagName('img').length == 1 and document.getElementsByTagName('div').length < 3 and document.getElementsByTagName('p').length < 2
|
only_img = document.getElementsByTagName('img').length == 1 and document.getElementsByTagName('div').length < 3 and document.getElementsByTagName('p').length < 2
|
||||||
this.is_full_screen_layout = (only_img or has_svg) and single_screen and document.body.scrollWidth > document.body.clientWidth
|
# We only set full_screen_layout if scrollWidth is in (clientWidth,
|
||||||
|
# 2*clientWidth) as if it is <= clientWidth scrolling will work
|
||||||
|
# anyway and if it is >= 2*clientWidth it can't be a full screen
|
||||||
|
# layout
|
||||||
|
this.is_full_screen_layout = (only_img or has_svg) and single_screen and document.body.scrollWidth > document.body.clientWidth and document.body.scrollWidth < 2 * document.body.clientWidth
|
||||||
if is_single_page
|
if is_single_page
|
||||||
this.is_full_screen_layout = true
|
this.is_full_screen_layout = true
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user