mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04: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
@ -214,7 +214,10 @@ class PDFWriter(QObject):
|
||||
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…
x
Reference in New Issue
Block a user