Skip to content

Instantly share code, notes, and snippets.

@steakhutzeee
Created August 24, 2024 14:13
Show Gist options
  • Save steakhutzeee/132a0837ef7ffc2c648b972950ed8762 to your computer and use it in GitHub Desktop.
Save steakhutzeee/132a0837ef7ffc2c648b972950ed8762 to your computer and use it in GitHub Desktop.
kfx conversion
Convert book 1 of 1 (Python Tips and Tricks - 50 Basic & Intermediate Tips & Tricks. Part 2)
DeDRM v10.0.9: Trying to decrypt gkumcxbe.pdf
DeDRM v10.0.9: gkumcxbe.pdf is an unencrypted PDF file - returning as is.
DeDRM v10.0.9: Finished after 0.1 seconds
Conversion options changed from defaults:
approximate_pages: True
cover: '/tmp/calibre_7.17.0_tmp_rn3q1fku/srqb0f_5.jpeg'
read_metadata_from_opf: '/tmp/calibre_7.17.0_tmp_rn3q1fku/_9ih3sn_.opf'
output_profile: 'tablet'
number_of_pages_field: '#pages'
verbose: 2
Resolved conversion options
calibre version: 7.17.0
{'add_alt_text_to_img': False,
'approximate_pages': True,
'asciiize': False,
'author_sort': None,
'authors': None,
'base_font_size': 0.0,
'book_producer': None,
'cde_type_pdoc': False,
'change_justification': 'original',
'chapter': "//*[((name()='h1' or name()='h2') and re:test(., "
"'\\s*((chapter|book|section|part)\\s+)|((prolog|prologue|epilogue)(\\s+|$))', "
"'i')) or @class = 'chapter']",
'chapter_mark': 'pagebreak',
'comments': None,
'cover': '/tmp/calibre_7.17.0_tmp_rn3q1fku/srqb0f_5.jpeg',
'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,
'enable_timeout': 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 0x7f3ef9b7de10>,
'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,
'new_pdf_engine': False,
'no_chapters_in_toc': False,
'no_images': False,
'no_inline_navbars': False,
'number_of_pages_field': '#pages',
'output_profile': <calibre.customize.profiles.TabletOutput object at 0x7f3ef999d8d0>,
'page_breaks_before': "//*[name()='h1' or name()='h2']",
'prefer_metadata_cover': False,
'pretty_print': True,
'pubdate': None,
'publisher': None,
'quality_report': False,
'rating': None,
'read_metadata_from_opf': '/tmp/calibre_7.17.0_tmp_rn3q1fku/_9ih3sn_.opf',
'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,
'show_kpr_logs': False,
'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,
'transform_css_rules': '[]',
'transform_html_rules': '[]',
'unsmarten_punctuation': False,
'unwrap_factor': 0.45,
'unwrap_lines': True,
'use_auto_toc': False,
'verbose': 2}
DeDRM v10.0.9: Trying to decrypt gkumcxbe.pdf
DeDRM v10.0.9: gkumcxbe.pdf is an unencrypted PDF file - returning as is.
DeDRM v10.0.9: Finished after 0.0 seconds
InputFormatPlugin: PDF Input running
on /tmp/calibre_7.17.0_tmp_rn3q1fku/gkumcxbe.pdf
Converting file to html...
pdftohtml log:
Page-1
Page-2
Page-3
Page-4
link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 Page-5
link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 link to page 0 Page-6
link to page 0 link to page 0 Page-7
Page-8
Page-9
Page-10
Page-11
Page-12
Page-13
Page-14
Page-15
Page-16
Page-17
Page-18
Page-19
Page-20
Page-21
Page-22
Page-23
Page-24
Page-25
Page-26
Page-27
Page-28
Page-29
Page-30
Page-31
Page-32
Page-33
Page-34
Page-35
Page-36
Page-37
Page-38
Page-39
Page-40
Page-41
Page-42
Page-43
Page-44
Page-45
Page-46
Page-47
Page-48
Page-49
Page-50
Page-51
Page-52
Page-53
Page-54
Page-55
Page-56
Page-57
Page-58
Page-59
Page-60
Page-61
Page-62
Page-63
Page-64
Page-65
Page-66
Retrieving document metadata...
Generating manifest...
Rendering manifest...
Parsing all content...
Parsing index.html ...
Referenced file 'file%3a///C%3a/Users/benji/OneDrive/Documents/benjaminbennettalexander%40gmail.com' not found
Generating default TOC from spine...
Merging user specified metadata...
Detecting structure...
Detected chapter: Part 2
Auto generated TOC with 3 entries.
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Removing fake margins...
Found 1461 items of level: p_1
Found 1 items of level: div_1
p_1 left margin stats: Counter({'0': 1461})
p_1 right margin stats: Counter({'0': 1461})
div_1 left margin stats: Counter()
div_1 right margin stats: Counter()
Cleaning up manifest...
Trimming unused files from manifest...
Creating KFX Output...
Software versions: KFX Output 2.9.0, calibre 7.17, Linux-6.10.5-1-default-x86_64-with-glibc2.40
KFX Output plugin help is available at http://www.mobileread.com/forums/showthread.php?t=272407
Page count value from field #pages: 66 ('66')
Splitting markup on page breaks and flow limits, if any...
Splitting on page-break at id=calibre_pb_0
Splitting on page-break at id=calibre_toc_2
Split into 2 parts
Removing anchor from TOC href: index_split_001.html#calibre_toc_2
Successfully converted input format to EPUB
Converting /tmp/calibre_7.17.0_tmp_rn3q1fku/0y1f0cvh.epub
Converting /tmp/calibre_7.17.0_tmp_rn3q1fku/0y1f0cvh.epub to KPF
Preparing book /tmp/calibre_7.17.0_tmp_rn3q1fku/0y1f0cvh.epub for conversion
Traceback (most recent call last):
File "calibre_plugins.kfx_output.kfxlib.original_source_epub", line 365, in prepare_for_previewer
self.prepare_ncx(f)
File "calibre_plugins.kfx_output.kfxlib.original_source_epub", line 768, in prepare_ncx
src = urlabspath(orig_src, working_dir=base_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "calibre_plugins.kfx_output.kfxlib.utilities", line 301, in urlabspath
return abspath(purl.path, working_dir) + ("#" + purl.fragment if purl.fragment else "")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "calibre_plugins.kfx_output.kfxlib.utilities", line 305, in abspath
return check_abs_path(posixpath.normpath(posixpath.join(check_abs_path(working_dir), check_rel_path(rel_path))))
^^^^^^^^^^^^^^^^^^^^^^^^
File "calibre_plugins.kfx_output.kfxlib.utilities", line 276, in check_rel_path
raise Exception("check_rel_path: '%s' is rooted" % path)
Exception: check_rel_path: '/C%3a/Users/benji/OneDrive/Documents/benjaminbennettalexander%40gmail.com' is rooted
WARNING: Failed to prepare EPUB toc.ncx: Exception("check_rel_path: '/C%3a/Users/benji/OneDrive/Documents/benjaminbennettalexander%40gmail.com' is rooted")
Launching Kindle Previewer 3 (unknown_36311040) - CLI
006c:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
006c:err:winediag:nodrv_CreateWindow L"The explorer process failed to start."
006c:err:systray:initialize_systray Could not create tray window
wine: Unhandled page fault on write access to 000000014230A000 at address 0000000140021DDA (thread 0024), starting debugger...
011c:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
011c:err:winediag:nodrv_CreateWindow L"Make sure that your X server is running and that $DISPLAY is set correctly."
0114:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0114:err:winediag:nodrv_CreateWindow L"Make sure that your X server is running and that $DISPLAY is set correctly."
0114:fixme:dbghelp:elf_search_auxv can't find symbol in module
0114:fixme:dbghelp:elf_search_auxv can't find symbol in module
0114:err:dbghelp:pe_load_msc_debug_info -Debug info stripped, but no .DBG file in module L"ucrtbase"
0114:err:dbghelp:pe_load_msc_debug_info -Debug info stripped, but no .DBG file in module L"kernel32"
0114:err:dbghelp:pe_load_msc_debug_info -Debug info stripped, but no .DBG file in module L"ntdll"
Process Failure: CLI return code 00000005
****************** Conversion Failure Reason *****************
Process Failure: CLI return code 00000005
**************************************************************
Traceback (most recent call last):
File "runpy.py", line 198, in _run_module_as_main
File "runpy.py", line 88, in _run_code
File "site.py", line 47, in <module>
File "site.py", line 43, in main
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 1307, in run
File "calibre_plugins.kfx_output.__init__", line 220, in convert
File "calibre_plugins.kfx_output.__init__", line 311, in convert_using_previewer
File "calibre_plugins.kfx_output.__init__", line 361, in report_failure
calibre.ebooks.conversion.ConversionUserFeedBack: {"msg": "<b>Cannot convert Python Tips and Tricks - 50 Basic &amp; Intermediate Tips &amp; Tricks. Part 2</b><br><br><b>Conversion error:</b> Process Failure: CLI return code 00000005", "level": "error", "det_msg": "", "title": "KFX conversion failed"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment