mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Dont delete toc pages if they empty PDF file
This commit is contained in:
parent
fdc0c7cf7e
commit
c091461b99
@ -528,6 +528,7 @@ def get_anchor_locations(pdf_doc, first_page_num, toc_uuid):
|
||||
ans = {}
|
||||
anchors = pdf_doc.extract_anchors()
|
||||
toc_pagenum = anchors.pop(toc_uuid)[0]
|
||||
if toc_pagenum > 1:
|
||||
pdf_doc.delete_pages(toc_pagenum, pdf_doc.page_count() - toc_pagenum + 1)
|
||||
for anchor, loc in iteritems(anchors):
|
||||
loc = list(loc)
|
||||
|
Loading…
x
Reference in New Issue
Block a user