From 579049affd0f4571aa4f5184ed776375ac0eccf8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 20 Oct 2019 10:13:26 +0530 Subject: [PATCH] PDF Output: Fix some books with full screen images failing to convert. Fixes #1848701 [Private bug](https://bugs.launchpad.net/calibre/+bug/1848701) --- src/calibre/ebooks/pdf/html_writer.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/calibre/ebooks/pdf/html_writer.py b/src/calibre/ebooks/pdf/html_writer.py index dc9d7bcf27..b7f54fd68b 100644 --- a/src/calibre/ebooks/pdf/html_writer.py +++ b/src/calibre/ebooks/pdf/html_writer.py @@ -363,13 +363,14 @@ def create_margin_files(container): # Link handling {{{ def add_anchors_markup(root, uuid, anchors): body = last_tag(root) - div = body.makeelement(XHTML('div'), id=uuid, style='page-break-before: always') + div = body.makeelement(XHTML('div'), id=uuid, style='display:block; page-break-before: always; break-before: always') body.append(div) def a(anchor): - div.append(div.makeelement(XHTML('a'), href='#' + anchor)) - div[-1].text = '\xa0' - div[-1].tail = ' ' + a = div.makeelement( + XHTML('a'), href='#' + anchor, style='white-space: pre; min-width: 10px; min-height: 10px; border: solid 1px') + a.text = a.tail = ' ' + div.append(a) tuple(map(a, anchors)) a(uuid)