mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Add a note about using page margins from the input document
This commit is contained in:
parent
974070ef93
commit
9f87cd7f99
@ -898,3 +898,28 @@ changes you like.
|
||||
|
||||
.calibre-pdf-toc .level-1 td:first-of-type { padding-left: 1.4em }
|
||||
.calibre-pdf-toc .level-2 td:first-of-type { padding-left: 2.8em }
|
||||
|
||||
|
||||
Custom page margins for individual HTML files
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
If you are converting an EPUB of AZW3 file with multiple individual HTML files
|
||||
inside it and you want to change the page margins for a particular HTML file
|
||||
you can add the following style block to the HTML file using the calibre
|
||||
editor:
|
||||
|
||||
.. code-block:: html
|
||||
|
||||
<style>
|
||||
@page {
|
||||
margin-left: 10pt;
|
||||
margin-right: 10pt;
|
||||
margin-top: 10pt;
|
||||
margin-bottom: 10pt;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Then, in the PDF output section of the conversion dialog, turn on the
|
||||
option to :guilabel:`Use page margins from the document being converted`.
|
||||
Now all pages generated from this HTML file will have ``10pt`` margins.
|
||||
|
@ -43,7 +43,6 @@ class PluginWidget(Widget, Ui_Form):
|
||||
self.initialize_options(get_option, get_help, db, book_id)
|
||||
self.layout().setFieldGrowthPolicy(self.layout().ExpandingFieldsGrow)
|
||||
self.template_box.layout().setFieldGrowthPolicy(self.layout().AllNonFixedFieldsGrow)
|
||||
self.toggle_margins()
|
||||
self.profile_size_toggled()
|
||||
|
||||
def profile_size_toggled(self):
|
||||
@ -52,17 +51,11 @@ class PluginWidget(Widget, Ui_Form):
|
||||
self.opt_custom_size.setEnabled(enabled)
|
||||
self.opt_unit.setEnabled(enabled)
|
||||
|
||||
def toggle_margins(self):
|
||||
enabled = not self.opt_pdf_use_document_margins.isChecked()
|
||||
for which in 'left top right bottom'.split():
|
||||
getattr(self, 'opt_pdf_page_margin_' + which).setEnabled(enabled)
|
||||
|
||||
def setupUi(self, *a):
|
||||
Ui_Form.setupUi(self, *a)
|
||||
v = self.page_margins_box.v = QVBoxLayout(self.page_margins_box)
|
||||
self.opt_pdf_use_document_margins = c = QCheckBox(_('Use page margins from the &document being converted'))
|
||||
v.addWidget(c)
|
||||
c.stateChanged.connect(self.toggle_margins)
|
||||
h = self.page_margins_box.h = QHBoxLayout()
|
||||
l = self.page_margins_box.l = QFormLayout()
|
||||
r = self.page_margins_box.r = QFormLayout()
|
||||
|
Loading…
x
Reference in New Issue
Block a user