mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
PDF Output: Option to control title of generated Table of Contents
Fixes #1245076 [[Enhancement] Add PDF TOC Title, More Margin Options and ePub TOC Heading 1](https://bugs.launchpad.net/calibre/+bug/1245076)
This commit is contained in:
parent
b05be6f902
commit
9d5ea30749
@ -112,6 +112,9 @@ class PDFOutput(OutputFormatPlugin):
|
||||
OptionRecommendation(name='pdf_add_toc', recommended_value=False,
|
||||
help=_('Add a Table of Contents at the end of the PDF that lists page numbers. '
|
||||
'Useful if you want to print out the PDF. If this PDF is intended for electronic use, use the PDF Outline instead.')),
|
||||
OptionRecommendation(name='toc_title', recommended_value=None,
|
||||
help=_('Title for generated table of contents.')
|
||||
),
|
||||
])
|
||||
|
||||
def convert(self, oeb_book, output_path, input_plugin, opts, log):
|
||||
|
@ -64,7 +64,7 @@ def toc_as_html(toc, pdf, opts):
|
||||
)
|
||||
),
|
||||
BODY(
|
||||
H1(_('Table of Contents')),
|
||||
H1(opts.toc_title or _('Table of Contents')),
|
||||
TABLE(),
|
||||
)
|
||||
)
|
||||
|
@ -23,7 +23,7 @@ class PluginWidget(Widget, Ui_Form):
|
||||
'preserve_cover_aspect_ratio', 'pdf_serif_family', 'unit',
|
||||
'pdf_sans_family', 'pdf_mono_family', 'pdf_standard_font',
|
||||
'pdf_default_font_size', 'pdf_mono_font_size', 'pdf_page_numbers',
|
||||
'pdf_footer_template', 'pdf_header_template', 'pdf_add_toc',
|
||||
'pdf_footer_template', 'pdf_header_template', 'pdf_add_toc', 'toc_title',
|
||||
])
|
||||
self.db, self.book_id = db, book_id
|
||||
|
||||
|
@ -232,6 +232,19 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QLineEdit" name="opt_toc_title"/>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
<string>&Title for ToC:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>opt_toc_title</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user