fail to convert azw3 to pdf in calibre 4.3

Bug #1852036 reported by Ernest Yao on 2019-11-11

This bug report will be marked for expiration in 49 days if no further activity occurs. (find out why)

6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Undecided
Unassigned

Bug Description

After updating to Calibre v4 (now v4.3.0), converting to PDF always gets error.
Environment: macOS 10.15.1, Calibre 4.3

Here's the error log and I upload the original azw3 as attachment.

calibre, version 4.3.0 (darwin, embedded-python: True)
转换错误: 失败: 转换书籍 第 1 本,共 1 本 (中央帝国密码三部曲(套装共3册)以技术化方式,从财政、哲学、军事角度,完整解读中央帝国从秦朝到清末两千多年的历史脉络)

转换书籍 第 1 本,共 1 本 (中央帝国密码三部曲(套装共3册)以技术化方式,从财政、哲学、军事角度,完整解读中央帝国从秦朝到清末两千多年的历史脉络)
Conversion options changed from defaults:
  pdf_mono_family: u'Courier New'
  paper_size: u'a4'
  insert_blank_line_size: 1.5
  chapter: u"//*[((name()='h1' or name()='h2') and re:test(., 'chapter|book|section|part|prologue|epilogue\\s+', 'i')) or @class = 'chapter']"
  max_toc_links: 500
  read_metadata_from_opf: u'/var/folders/tv/8456g_ks4wgb37_yyjpj0kk00000gp/C/calibre_4.3.0_tmp_8fyLnX/D256JF.opf'
  preserve_cover_aspect_ratio: True
  pdf_serif_family: u'FZYaSongS-L-GB'
  pdf_sans_family: u'PingFang SC'
  embed_all_fonts: True
  verbose: 2
  minimum_line_height: 180.0
  output_profile: u'kindle_voyage'
  pdf_mono_font_size: 20
  cover: u'/var/folders/tv/8456g_ks4wgb37_yyjpj0kk00000gp/C/calibre_4.3.0_tmp_8fyLnX/Jowb_N.jpeg'
Resolved conversion options
calibre version: 4.3.0
{'asciiize': False,
 'author_sort': None,
 'authors': None,
 'base_font_size': 0.0,
 'book_producer': None,
 'change_justification': u'original',
 'chapter': u"//*[((name()='h1' or name()='h2') and re:test(., 'chapter|book|section|part|prologue|epilogue\\s+', 'i')) or @class = 'chapter']",
 'chapter_mark': u'pagebreak',
 'comments': None,
 'cover': u'/var/folders/tv/8456g_ks4wgb37_yyjpj0kk00000gp/C/calibre_4.3.0_tmp_8fyLnX/Jowb_N.jpeg',
 'custom_size': None,
 'debug_pipeline': None,
 'dehyphenate': True,
 'delete_blank_paragraphs': True,
 'disable_font_rescaling': False,
 'duplicate_links_in_toc': False,
 'embed_all_fonts': True,
 'embed_font_family': None,
 'enable_heuristics': False,
 'expand_css': False,
 'extra_css': None,
 'filter_css': u'',
 '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 0x1093f5a90>,
 'insert_blank_line': False,
 'insert_blank_line_size': 1.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': 500,
 'minimum_line_height': 180.0,
 'no_chapters_in_toc': False,
 'no_inline_navbars': False,
 'output_profile': <calibre.customize.profiles.KindleVoyageOutput object at 0x1094c2310>,
 'page_breaks_before': u"//*[name()='h1' or name()='h2']",
 'paper_size': u'a4',
 'pdf_add_toc': False,
 'pdf_default_font_size': 20,
 'pdf_footer_template': None,
 'pdf_header_template': None,
 'pdf_hyphenate': False,
 'pdf_mark_links': False,
 'pdf_mono_family': u'Courier New',
 'pdf_mono_font_size': 20,
 'pdf_page_margin_bottom': 72.0,
 'pdf_page_margin_left': 72.0,
 'pdf_page_margin_right': 72.0,
 'pdf_page_margin_top': 72.0,
 'pdf_page_number_map': None,
 'pdf_page_numbers': False,
 'pdf_sans_family': u'PingFang SC',
 'pdf_serif_family': u'FZYaSongS-L-GB',
 'pdf_standard_font': u'serif',
 'pdf_use_document_margins': False,
 'prefer_metadata_cover': False,
 'preserve_cover_aspect_ratio': True,
 'pretty_print': False,
 'pubdate': None,
 'publisher': None,
 'rating': None,
 'read_metadata_from_opf': u'/var/folders/tv/8456g_ks4wgb37_yyjpj0kk00000gp/C/calibre_4.3.0_tmp_8fyLnX/D256JF.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': u'',
 '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': '[]',
 'uncompressed_pdf': False,
 'unit': u'inch',
 'unsmarten_punctuation': False,
 'unwrap_lines': True,
 'use_auto_toc': False,
 'use_profile_size': False,
 'verbose': 2}
InputFormatPlugin: MOBI Input running
on /var/folders/tv/8456g_ks4wgb37_yyjpj0kk00000gp/C/calibre_4.3.0_tmp_8fyLnX/sR1v6u.azw3
Found KF8 MOBI of type u'standalone'
Extracting text...
Parsing all content...
Parsing text/part0044.html ...
Parsing text/part0032.html ...
Parsing text/part0052.html ...
Parsing text/part0006.html ...
Parsing text/part0005.html ...
Parsing text/part0029.html ...
Parsing text/part0025.html ...
Parsing text/part0053.html ...
Parsing styles/0006.css ...
Parsing styles/0010.css ...
Parsing styles/0009.css ...
Parsing text/part0033.html ...
Parsing text/part0050.html ...
Parsing text/part0024.html ...
Parsing text/part0031.html ...
Parsing text/part0008.html ...
Parsing text/part0007.html ...
Parsing text/part0030.html ...
Parsing text/part0021.html ...
Parsing text/part0001.html ...
Parsing text/part0012.html ...
Parsing text/part0020.html ...
Parsing text/part0056.html ...
Parsing styles/0007.css ...
Parsing text/part0015.html ...
Parsing text/part0042.html ...
Parsing text/part0049.html ...
Parsing text/part0003.html ...
Parsing styles/0003.css ...
Parsing text/part0040.html ...
Parsing text/part0037.html ...
Parsing text/part0051.html ...
Parsing text/part0036.html ...
Parsing text/part0061.html ...
Parsing text/part0017.html ...
Parsing text/part0016.html ...
Parsing text/part0041.html ...
Parsing text/part0057.html ...
Parsing text/part0060.html ...
Parsing text/part0028.html ...
Parsing styles/0001.css ...
Parsing text/part0046.html ...
Parsing text/part0027.html ...
Parsing text/part0039.html ...
Parsing text/part0004.html ...
Parsing text/part0019.html ...
Parsing text/part0058.html ...
Parsing text/part0023.html ...
Parsing text/part0011.html ...
Parsing text/part0035.html ...
Parsing text/part0062.html ...
Parsing text/part0034.html ...
Parsing text/part0000.html ...
Parsing text/part0022.html ...
Parsing text/part0059.html ...
Parsing text/part0010.html ...
Parsing text/part0018.html ...
Parsing text/part0038.html ...
Parsing text/part0045.html ...
Parsing text/part0002.html ...
Parsing text/part0055.html ...
Parsing styles/0004.css ...
Parsing text/part0043.html ...
Parsing text/part0047.html ...
Parsing text/part0014.html ...
Parsing text/part0054.html ...
Parsing text/part0048.html ...
Parsing text/part0009.html ...
Parsing text/part0026.html ...
Parsing text/part0013.html ...
Referenced file u'styles/XXXXXXXXXXXXXXXX' not found
Reading TOC from NCX...
Merging user specified metadata...
Detecting structure...
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Removing fake margins...
Found 59 items of level: div_2
Found 253 items of level: div_3
Found 276 items of level: div_1
Found 10890 items of level: p_1
Found 11 items of level: p_2
Ignoring level p_2
div_2 left margin stats: Counter({u'2em': 24})
div_2 right margin stats: Counter({u'': 24})
Removing level div_2 left margin of: 2em
div_3 left margin stats: Counter({u'': 253})
div_3 right margin stats: Counter({u'': 253})
div_1 left margin stats: Counter({u'0': 15})
div_1 right margin stats: Counter({u'': 15})
p_1 left margin stats: Counter({u'0': 10890})
p_1 right margin stats: Counter({u'0': 10890})
Failed to find fonts for family: MYing Hei S not embedding
Failed to find fonts for family: STKai not embedding
Failed to find fonts for family: Hei not embedding
Failed to find fonts for family: MYing Hei not embedding
Cleaning up manifest...
Trimming unused files from manifest...
Trimming u'images/00056.unknown' from manifest
Trimming u'images/00059.unknown' from manifest
Trimming u'images/00046.unknown' from manifest
Trimming u'images/00047.unknown' from manifest
Trimming u'images/00043.jpeg' from manifest
Trimming u'images/00061.unknown' from manifest
Trimming u'images/00062.unknown' from manifest
Trimming u'images/00058.unknown' from manifest
Trimming u'images/00049.unknown' from manifest
Trimming u'images/00055.unknown' from manifest
Trimming u'images/00050.unknown' from manifest
Trimming u'images/00060.unknown' from manifest
Trimming u'images/00052.unknown' from manifest
Trimming u'images/00057.unknown' from manifest
Trimming u'images/00054.unknown' from manifest
Trimming u'images/00051.unknown' from manifest
Trimming u'images/00048.unknown' from manifest
Trimming u'images/00053.unknown' from manifest
Creating PDF Output...
Converting input as a text based book...
Python function terminated unexpectedly: 'UnknownTable' object has no attribute 'read_data'
Traceback (most recent call last):
  File "/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/site.py", line 163, in main
    return run_entry_point()
  File "/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/site.py", line 121, in run_entry_point
    return getattr(pmod, func)()
  File "site-packages/calibre/utils/ipc/worker.py", line 208, in main
  File "site-packages/calibre/gui2/convert/gui_conversion.py", line 43, in gui_convert_override
  File "site-packages/calibre/gui2/convert/gui_conversion.py", line 28, in gui_convert
  File "site-packages/calibre/ebooks/conversion/plumber.py", line 1275, in run
  File "site-packages/calibre/ebooks/conversion/plugins/pdf_output.py", line 176, in convert
  File "site-packages/calibre/ebooks/conversion/plugins/pdf_output.py", line 243, in convert_text
  File "site-packages/calibre/ebooks/pdf/html_writer.py", line 1193, in convert
  File "site-packages/calibre/ebooks/pdf/html_writer.py", line 937, in merge_fonts
  File "site-packages/calibre/ebooks/pdf/html_writer.py", line 893, in merge_font
  File "site-packages/calibre/utils/fonts/sfnt/merge.py", line 44, in merge_truetype_fonts_for_pdf
AttributeError: 'UnknownTable' object has no attribute 'read_data'

Ernest Yao (ernestyao) wrote :
description: updated

Works fine for me with default options. That error has to do with
subsetting fonts, what fonts are you using? From the log it looks like
Ping Fang and FZYASongs but I get no errors with those either, though I
dont know if they are installed on my macOS machine or itis using a
fallback.

 status incomplete

Changed in calibre:
status: New → Incomplete

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Changed in calibre:
status: Incomplete → Fix Released
Ernest Yao (ernestyao) wrote :

Yes, I'm using FZYaSongS-L-GB. It's installed in my macbook. The same options work in latest v3.

I'll try in the next release. Thank you.

Ernest Yao (ernestyao) wrote :
Download full text (9.8 KiB)

After updating to v4.4 today, we have the latest error log:

转换书籍 第 1 本,共 1 本 (中央帝国密码三部曲(套装共3册)以技术化方式,从财政、哲学、军事角度,完整解读中央帝国从秦朝到清末两千多年的历史脉络)
Conversion options changed from defaults:
  chapter: u"//*[((name()='h1' or name()='h2') and re:test(., 'chapter|book|section|part|prologue|epilogue\\s+', 'i')) or @class = 'chapter']"
  pdf_mono_family: u'Courier New'
  minimum_line_height: 180.0
  pdf_mono_font_size: 20
  preserve_cover_aspect_ratio: True
  pdf_serif_family: u'FZYaSongS-L-GB'
  paper_size: u'a4'
  pdf_sans_family: u'PingFang SC'
  insert_blank_line_size: 1.5
  max_toc_links: 500
  verbose: 2
  read_metadata_from_opf: u'/var/folders/tv/8456g_ks4wgb37_yyjpj0kk00000gp/C/calibre_4.4.0_tmp_VARgUb/xrredW.opf'
  cover: u'/var/folders/tv/8456g_ks4wgb37_yyjpj0kk00000gp/C/calibre_4.4.0_tmp_VARgUb/x_em5G.jpeg'
  embed_all_fonts: True
  output_profile: u'kindle_voyage'
Resolved conversion options
calibre version: 4.4.0
{'asciiize': False,
 'author_sort': None,
 'authors': None,
 'base_font_size': 0.0,
 'book_producer': None,
 'change_justification': u'original',
 'chapter': u"//*[((name()='h1' or name()='h2') and re:test(., 'chapter|book|section|part|prologue|epilogue\\s+', 'i')) or @class = 'chapter']",
 'chapter_mark': u'pagebreak',
 'comments': None,
 'cover': u'/var/folders/tv/8456g_ks4wgb37_yyjpj0kk00000gp/C/calibre_4.4.0_tmp_VARgUb/x_em5G.jpeg',
 'custom_size': None,
 'debug_pipeline': None,
 'dehyphenate': True,
 'delete_blank_paragraphs': True,
 'disable_font_rescaling': False,
 'duplicate_links_in_toc': False,
 'embed_all_fonts': True,
 'embed_font_family': None,
 'enable_heuristics': False,
 'expand_css': False,
 'extra_css': None,
 'filter_css': u'',
 '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 0x113fe2b50>,
 'insert_blank_line': False,
 'insert_blank_line_size': 1.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': 500,
 'minimum_line_height': 180.0,
 'no_chapters_in_toc': False,
 'no_inline_navbars': False,
 'output_profile': <calibre.customize.profiles.KindleVoyageOutput object at 0x1140af3d0>,
 'page_breaks_before': u"//*[name()='h1' or name()='h2']",
 'paper_size': u'a4',
 'pdf_add_toc': False,
 'pdf_default_font_size': 20,
 'pdf_footer_template': None,
 'pdf_header_template': None,
 'pdf_hyphenate': False,
 'pdf_mark_links': False,
 'pdf_mono_family': u'Courier New',
 'pdf_mono_font_size': 20,
 'pdf_page_margin_bottom': 72.0,
 'pdf_page_margin_left': 72.0,
 'pdf_page_margin_right': 72.0,
 'pdf_page_margin_top': 72.0,
 'pdf_page_number_map': None,
 'pdf_page_numbers': False,
 'pdf_sans_family': u'PingFang SC',
 'pdf_serif_family': u'FZYaSongS-L-GB',
 'pdf_standard_font': u'serif',
 'pdf_use_document_margins': False,
 'prefer_metadata_cover': False,
 'preserve_cover...

Changed in calibre:
status: Fix Released → Incomplete

Oh yeah, sorry forgot to fix one place, will be in the next release.

Ernest Yao (ernestyao) wrote :
Download full text (13.5 KiB)

This time(with v4.5):

转换书籍 第 1 本,共 1 本 (全译罗马帝国衰亡史(读客熊猫君出品,套装全12册。一部横跨1300年,讲述罗马帝国由盛而衰的恢弘史诗。))
Conversion options changed from defaults:
  chapter: u"//*[((name()='h1' or name()='h2') and re:test(., 'chapter|book|section|part|prologue|epilogue\\s+', 'i')) or @class = 'chapter']"
  pdf_mono_family: u'Courier New'
  pdf_mono_font_size: 20
  preserve_cover_aspect_ratio: True
  embed_all_fonts: True
  verbose: 2
  output_profile: u'kindle_voyage'
  insert_blank_line_size: 1.5
  minimum_line_height: 180.0
  max_toc_links: 500
  pdf_serif_family: u'FZYaSongS-L-GB'
  paper_size: u'a4'
  cover: u'/var/folders/tv/8456g_ks4wgb37_yyjpj0kk00000gp/C/calibre_4.5.0_tmp_jTcH2j/mDjH6G.jpeg'
  pdf_sans_family: u'PingFang SC'
  read_metadata_from_opf: u'/var/folders/tv/8456g_ks4wgb37_yyjpj0kk00000gp/C/calibre_4.5.0_tmp_jTcH2j/c1iZKM.opf'
Resolved conversion options
calibre version: 4.5.0
{'asciiize': False,
 'author_sort': None,
 'authors': None,
 'base_font_size': 0.0,
 'book_producer': None,
 'change_justification': u'original',
 'chapter': u"//*[((name()='h1' or name()='h2') and re:test(., 'chapter|book|section|part|prologue|epilogue\\s+', 'i')) or @class = 'chapter']",
 'chapter_mark': u'pagebreak',
 'comments': None,
 'cover': u'/var/folders/tv/8456g_ks4wgb37_yyjpj0kk00000gp/C/calibre_4.5.0_tmp_jTcH2j/mDjH6G.jpeg',
 'custom_size': None,
 'debug_pipeline': None,
 'dehyphenate': True,
 'delete_blank_paragraphs': True,
 'disable_font_rescaling': False,
 'duplicate_links_in_toc': False,
 'embed_all_fonts': True,
 'embed_font_family': None,
 'enable_heuristics': False,
 'expand_css': False,
 'extra_css': None,
 'filter_css': u'',
 '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 0x10b37cbd0>,
 'insert_blank_line': False,
 'insert_blank_line_size': 1.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': 500,
 'minimum_line_height': 180.0,
 'no_chapters_in_toc': False,
 'no_inline_navbars': False,
 'output_profile': <calibre.customize.profiles.KindleVoyageOutput object at 0x10b44a450>,
 'page_breaks_before': u"//*[name()='h1' or name()='h2']",
 'paper_size': u'a4',
 'pdf_add_toc': False,
 'pdf_default_font_size': 20,
 'pdf_footer_template': None,
 'pdf_header_template': None,
 'pdf_hyphenate': False,
 'pdf_mark_links': False,
 'pdf_mono_family': u'Courier New',
 'pdf_mono_font_size': 20,
 'pdf_odd_even_offset': 0.0,
 'pdf_page_margin_bottom': 72.0,
 'pdf_page_margin_left': 72.0,
 'pdf_page_margin_right': 72.0,
 'pdf_page_margin_top': 72.0,
 'pdf_page_number_map': None,
 'pdf_page_numbers': False,
 'pdf_sans_family': u'PingFang SC',
 'pdf_serif_family': u'FZYaSongS-L-GB',
 'pdf_standard_font': u'serif',
 'pdf_use_document_margins': False,
 'prefer_metadata_cover': False,
 'preserve_cover_aspect_ratio':...

Kovid Goyal (kovid) wrote :

fixed in next release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers