mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 20:14:33 +02:00
PDF Output: Ignore links whose page refs cannot be found, instead of erroring out
This commit is contained in:
parent
890b5e4c57
commit
b3af0799f9
1 changed files with 5 additions and 1 deletions
|
|
@ -44,7 +44,11 @@ def add(self, base_path, start_page, links, anchors):
|
|||
for link in links:
|
||||
href, page, rect = link
|
||||
p, frag = href.partition('#')[0::2]
|
||||
link = ((path, p, frag or None), self.pdf.get_pageref(page).obj, Array(rect))
|
||||
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…
Reference in a new issue