mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
PDF Output: Fix an error that could occur in rare circumstances when using the option to read page margins from the input document
Fixes #1792616 [conversion from ePub to PDF fails](https://bugs.launchpad.net/calibre/+bug/1792616)
This commit is contained in:
parent
1f980f7097
commit
23ac6054e8
@ -260,6 +260,7 @@ class PDFOutput(OutputFormatPlugin):
|
||||
import json
|
||||
for href, margins in self.stored_page_margins.iteritems():
|
||||
item = oeb_book.manifest.hrefs.get(href)
|
||||
if item is not None:
|
||||
root = item.data
|
||||
if hasattr(root, 'xpath') and margins:
|
||||
root.set('data-calibre-pdf-output-page-margins', json.dumps(margins))
|
||||
|
Loading…
x
Reference in New Issue
Block a user