From c0e9d14ba1c655427a67488268a6c67366ec9cd6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 12 Feb 2014 11:30:33 +0530 Subject: [PATCH] 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) --- resources/compiled_coffeescript.zip | Bin 78965 -> 79026 bytes src/calibre/ebooks/oeb/display/paged.coffee | 6 +++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/compiled_coffeescript.zip b/resources/compiled_coffeescript.zip index cc015df94aeef8b9a64a4aca6eb6bd8b111dddd6..b1312cffc9b5a85941f6f5553223fa8006d25318 100644 GIT binary patch delta 268 zcmezRf@RZ77V!XYW)=|!5SSh9<1#HmFf=2Yfgxk_AA?wh$qIpTtTqZp3R;`(14XPi z-x3g2*c{xWvUDTU1p!S)CJ|;VI)S>S!REn?X57+dMMnGMgS|=w?lbvp53}nkpnZD4FQDpM{C7jcn zK>~@h!NwdhW;9?b`~zlln=qO%g>X)HG+|VjUT(;!!SqN0#1WZjz$+Hu&B_L{iVFx| MF)=V~GGqku02((!5C8xG delta 250 zcmdn=lI80QmhF!e7%vG-mYc${d3Cg?f?$@{Cnt_82UlrFGcbU#^yG`xVjB&e6*g~F z_+_>EK()%!>47GU8q@C>GV)Kaq1C BNXY;I diff --git a/src/calibre/ebooks/oeb/display/paged.coffee b/src/calibre/ebooks/oeb/display/paged.coffee index 39c4b12fe9..74359a1efb 100644 --- a/src/calibre/ebooks/oeb/display/paged.coffee +++ b/src/calibre/ebooks/oeb/display/paged.coffee @@ -176,7 +176,11 @@ class PagedDisplay # with height=100% overflow the first column 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 - 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 this.is_full_screen_layout = true