mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-22 00:34:48 +01:00
PDF Output: Fix error when trying to convert books that do not specify a language in their metadata. Fixes #1783563 [epub to pdf error](https://bugs.launchpad.net/calibre/+bug/1783563)
This commit is contained in:
parent
853cb8f191
commit
81de667d54
1 changed files with 4 additions and 1 deletions
|
|
@ -214,7 +214,10 @@ def margin(which):
|
|||
self.margin_top, self.margin_bottom = map(lambda x:int(floor(x)), (mt, mb))
|
||||
|
||||
self.painter = QPainter(self.doc)
|
||||
self.book_language = pdf_metadata.mi.languages[0]
|
||||
try:
|
||||
self.book_language = pdf_metadata.mi.languages[0]
|
||||
except Exception:
|
||||
self.book_language = 'eng'
|
||||
self.doc.set_metadata(title=pdf_metadata.title,
|
||||
author=pdf_metadata.author,
|
||||
tags=pdf_metadata.tags, mi=pdf_metadata.mi)
|
||||
|
|
|
|||
Loading…
Reference in a new issue