mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
PDF Output: Ignore links whose page refs cannot be found, instead of erroring out
This commit is contained in:
parent
890b5e4c57
commit
b3af0799f9
@ -44,7 +44,11 @@ class Links(object):
|
||||
for link in links:
|
||||
href, page, rect = link
|
||||
p, frag = href.partition('#')[0::2]
|
||||
try:
|
||||
link = ((path, p, frag or None), self.pdf.get_pageref(page).obj, Array(rect))
|
||||
except IndexError:
|
||||
self.log.warn('Unable to find page for link: %r, ignoring it' % link)
|
||||
continue
|
||||
self.links.append(link)
|
||||
|
||||
def add_links(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user