PDF Output: Do not error out when the input document contains links with anchors not present in the document. Fixes #1096428 (pdf conversion fails in 0.9.13 64 bit calibre)

This commit is contained in:
Kovid Goyal 2013-01-06 01:14:36 +05:30
parent b88d2f8dc2
commit 7720a696d8

View File

@ -58,7 +58,13 @@ class Links(object):
0])})
if is_local:
path = combined_path if href else path
try:
annot['Dest'] = self.anchors[path][frag]
except KeyError:
try:
annot['Dest'] = self.anchors[path][None]
except KeyError:
pass
else:
url = href + (('#'+frag) if frag else '')
purl = urlparse(url)