I am unable to convert an EPUB file (29 MB) to PDF.
At the end of the conversion process I get the error message below.
Unfortunately, I don't know the exact English terms, so I have translated freely from German for the red-coded parts. Where I have shortened, it says XXX instead.
Only at the very end of the error message is there an error note, but I don't understand it and I don't know if this might be the only hint to what went wrong:
"ValueError: The number of header/footers pages (42314) != number of document pages (48270)"
Spoiler:
calibre, version 6.3.0 (win32, embedded-python: True) Conversion error: Failed to convert book 1 of 1 (XXX) convert
Book 1 of 1 (XXX) convert
Conversion options changed from defaults:
pdf_default_font_size: 16
pdf_page_numbers: True
pdf_page_margin_right: 50.0
cover: XXX
pdf_page_margin_left: 50.0
pdf_page_margin_bottom: 50.0
verbose: 2
paper_size: 'a5'
read_metadata_from_opf: XXX
unit: 'centimeter'
pdf_page_margin_top: 50.0
pdf_sans_family: 'MS Gothic'
pdf_serif_family: 'Arial'
pdf_mono_family: 'Courier New'
Resolved conversion options
calibre version: 6.3.0
{'asciiize': False,
'author_sort': None,
'authors': None,
'base_font_size': 0.0,
'book_producer': None,
'change_justification': 'original',
'chapter': "//*[((name()='h1' or name()='h2') and re:test(., "
"'\\s*((chapter|book|section|part)\\s+)|((prolog|p rologue|epilogue)(\\s+|$))', "
"'i')) or @class = 'chapter']",
'chapter_mark': 'pagebreak',
'comments': None,
'cover': XXX,
'custom_size': None,
'debug_pipeline': None,
'dehyphenate': True,
'delete_blank_paragraphs': True,
'disable_font_rescaling': False,
'duplicate_links_in_toc': False,
'embed_all_fonts': False,
'embed_font_family': None,
'enable_heuristics': False,
'expand_css': False,
'extra_css': None,
'filter_css': '',
'fix_indents': True,
'font_size_mapping': None,
'format_scene_breaks': True,
'html_unwrap_factor': 0.4,
'input_encoding': None,
'input_profile': <calibre.customize.profiles.InputProfile object at 0x000001305571D1B0>,
'insert_blank_line': False,
'insert_blank_line_size': 0.5,
'insert_metadata': False,
'isbn': None,
'italicize_common_cases': True,
'keep_ligatures': False,
'language': None,
'level1_toc': None,
'level2_toc': None,
'level3_toc': None,
'line_height': 0.0,
'linearize_tables': False,
'margin_bottom': 5.0,
'margin_left': 5.0,
'margin_right': 5.0,
'margin_top': 5.0,
'markup_chapter_headings': True,
'max_toc_links': 50,
'minimum_line_height': 120.0,
'no_chapters_in_toc': False,
'no_inline_navbars': False,
'output_profile': <calibre.customize.profiles.OutputProfile object at 0x000001305571CEE0>,
'page_breaks_before': '/',
'paper_size': 'a5',
'pdf_add_toc': False,
'pdf_default_font_size': 16,
'pdf_footer_template': None,
'pdf_header_template': None,
'pdf_hyphenate': False,
'pdf_mark_links': False,
'pdf_mono_family': 'Courier New',
'pdf_mono_font_size': 16,
'pdf_odd_even_offset': 0.0,
'pdf_page_margin_bottom': 50.0,
'pdf_page_margin_left': 50.0,
'pdf_page_margin_right': 50.0,
'pdf_page_margin_top': 50.0,
'pdf_page_number_map': None,
'pdf_page_numbers': True,
'pdf_sans_family': 'MS Gothic',
'pdf_serif_family': 'Arial',
'pdf_standard_font': 'serif',
'pdf_use_document_margins': False,
'prefer_metadata_cover': False,
'preserve_cover_aspect_ratio': False,
'pretty_print': False,
'pubdate': None,
'publisher': None,
'rating': None,
'read_metadata_from_opf': XXX,
'remove_fake_margins': True,
'remove_first_image': False,
'remove_paragraph_spacing': False,
'remove_paragraph_spacing_indent_size': 1.5,
'renumber_headings': True,
'replace_scene_breaks': '',
'search_replace': '[]',
'series': None,
'series_index': None,
'smarten_punctuation': False,
'sr1_replace': None,
'sr1_search': None,
'sr2_replace': None,
'sr2_search': None,
'sr3_replace': None,
'sr3_search': None,
'start_reading_at': None,
'subset_embedded_fonts': False,
'tags': None,
'timestamp': None,
'title': None,
'title_sort': None,
'toc_filter': None,
'toc_threshold': 6,
'toc_title': None,
'transform_css_rules': '[]',
'transform_html_rules': '[]',
'uncompressed_pdf': False,
'unit': 'centimeter',
'unsmarten_punctuation': False,
'unwrap_lines': True,
'use_auto_toc': False,
'use_profile_size': False,
'verbose': 2}
InputFormatPlugin: EPUB Input running
on XXX.epub
Found HTML cover titlepage.xhtml
Parsing all content...
Parsing text/part3188.html ...
Parsing text/part3252.html ...
XXX
Parsing text/part1619_split_001.html ...
XXX
Reading TOC from NCX...
Merging user specified metadata...
Detecting structure...
Detected chapter: Inhaltsverzeichnis
XXX
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Removing fake margins...
Found 17588 items of level: div_1
Found 167818 items of level: p_1
Found 4257 items of level: p_2
Found 717 items of level: div_2
Found 10065 items of level: p_3
Found 415 items of level: div_3
Found 108 items of level: div_4
Found 1979 items of level: p_5
Found 6709 items of level: div_5
Found 2190 items of level: p_6
Found 2384 items of level: p_4
Found 13332 items of level: div_6
div_1 left margin stats: Counter({'': 305, '0': 20, '1.5em': 12, '10%': 6, '5%': 5, '2em': 2, '2.5em': 1})
div_1 right margin stats: Counter({'': 305, '3px': 20, '1.5em': 14, '10%': 6, '5%': 5, '2em': 1})
Negative text indent detected at level p_1, ignoring this level
Negative text indent detected at level p_2, ignoring this level
div_2 left margin stats: Counter({'': 162, '1.5em': 11, '5%': 3})
div_2 right margin stats: Counter({'': 162, '3px': 11, '5%': 3})
Negative text indent detected at level p_3, ignoring this level
div_3 left margin stats: Counter({'': 322, '2.5em': 93})
div_3 right margin stats: Counter({'': 322, '3px': 93})
div_4 left margin stats: Counter({'': 108})
div_4 right margin stats: Counter({'': 108})
Negative text indent detected at level p_5, ignoring this level
div_5 left margin stats: Counter({'': 6709})
div_5 right margin stats: Counter({'': 6709})
p_6 left margin stats: Counter({'0': 2190})
p_6 right margin stats: Counter({'0': 2190})
Negative text indent detected at level p_4, ignoring this level
div_6 left margin stats: Counter({'': 13332})
div_6 right margin stats: Counter({'': 13332})
Cleaning up manifest...
Trimming unused files from manifest...
Trimming 'titlepage.xhtml' from manifest
Creating PDF Output...
Converting input as a text based book...
The cover image has an id != "cover". Renaming to work around bug in Nook Color
Traceback (most recent call last):
File "runpy.py", line 196, in _run_module_as_main
File "runpy.py", line 86, in _run_code
File "site.py", line 82, in <module>
File "site.py", line 77, in main
File "site.py", line 49, in run_entry_point
File "calibre\utils\ipc\worker.py", line 215, in main
File "calibre\gui2\convert\gui_conversion.py", line 38, in gui_convert_override
File "calibre\gui2\convert\gui_conversion.py", line 25, in gui_convert
File "calibre\ebooks\conversion\plumber.py", line 1281, in run
File "calibre\ebooks\conversion\plugins\pdf_output. py", line 183, in convert
File "calibre\ebooks\conversion\plugins\pdf_output. py", line 249, in convert_text
File "calibre\ebooks\pdf\html_writer.py", line 1179, in convert
File "calibre\ebooks\pdf\html_writer.py", line 1071, in add_header_footer
ValueError: The number of header/footers pages (42314) != number of document pages (48270)
Last edited by theducks; 09-09-2022 at 09:48 AM.
Reason: spoilered