diff --git a/src/calibre/ebooks/conversion/plugins/docx_output.py b/src/calibre/ebooks/conversion/plugins/docx_output.py index 5daba84317..9eba4b03d1 100644 --- a/src/calibre/ebooks/conversion/plugins/docx_output.py +++ b/src/calibre/ebooks/conversion/plugins/docx_output.py @@ -18,6 +18,7 @@ class DOCXOutput(OutputFormatPlugin): author = 'Kovid Goyal' file_type = 'docx' commit_name = 'docx_output' + ui_data = {'page_sizes': PAGE_SIZES} options = { OptionRecommendation(name='docx_page_size', recommended_value='letter', diff --git a/src/pyj/book_list/conversion_widgets.pyj b/src/pyj/book_list/conversion_widgets.pyj index b4630dc81b..9fb23cc1ff 100644 --- a/src/pyj/book_list/conversion_widgets.pyj +++ b/src/pyj/book_list/conversion_widgets.pyj @@ -543,6 +543,22 @@ def epub_output(container): g.appendChild(choices('epub_version', _('EP&UB version:'), ui_data.versions)) # }}} +# DOCX Output {{{ +@ep +def docx_output(container): + g = E.div(class_='simple-group') + container.appendChild(g) + g.appendChild(choices('docx_page_size', _('Paper si&ze:'), ui_data.page_sizes)) + g.appendChild(lineedit('docx_custom_page_size', _('&Custom size:'))) + g.appendChild(float_spin('docx_page_margin_left', _('Page &left margin'), unit='pt', min=-100, max=500)) + g.appendChild(float_spin('docx_page_margin_top', _('Page &top margin'), unit='pt', min=-100, max=500)) + g.appendChild(float_spin('docx_page_margin_right', _('Page &right margin'), unit='pt', min=-100, max=500)) + g.appendChild(float_spin('docx_page_margin_bottom', _('Page &bottom margin'), unit='pt', min=-100, max=500)) + g.appendChild(checkbox('docx_no_toc', _('Do not insert the &Table of Contents as a page at the start of the document'))) + g.appendChild(checkbox('docx_no_cover', _('Do not insert &cover as image at start of document'))) + g.appendChild(checkbox('preserve_cover_aspect_ratio', _('Preserve the aspect ratio of the image inserted as cover'))) +# }}} + def restore_defaults(): for setting in registry: set(setting, get_option_default_value(setting))