EBOOK-CONVERT(1) calibre EBOOK-CONVERT(1)
NAME
ebook-convert - ebook-convert
ebook-convert input_file output_file [options]
Convert an e-book from one format to another.
input_file is the input and output_file is the output. Both must be
specified as the first two arguments to the command.
The output e-book format is guessed from the file extension of
output_file. output_file can also be of the special format .EXT where
EXT is the output file extension. In this case, the name of the output
file is derived from the name of the input file. Note that the
filenames must not start with a hyphen. Finally, if output_file has no
extension, then it is treated as a folder and an "open e-book" (OEB)
consisting of HTML files is written to that folder. These files are the
files that would normally have been passed to the output plugin.
After specifying the input and output file you can customize the
conversion by specifying various options. The available options depend
on the input and output file types. To get help on them specify the
input and output file and then use the -h option.
For full documentation of the conversion system see E-book conversion
Whenever you pass arguments to ebook-convert that have spaces in them,
enclose the arguments in quotation marks. For example: "/some path/with
spaces"
The options and default values for the options change depending on both
the input and output formats, so you should always check with:
ebook-convert myfile.input_format myfile.output_format -h
Below are the options that are common to all conversion, followed by
the options specific to every input and output format.
o TU> CH>N NH>P
o TU> CH>N XU>T
o LOOK AND FEEL
o HEURISTIC PROCESSING
o SEARCH AND REPLACE
o STRUCTURE DETECTION
o TABLE OF CONTENTS
o METADATA
o DEBUG
--help, -h
show this help message and exit
--input-profile
Xac d>nh h> so nh>p. H> so nh>p cung c>p cho h>
th>ng chuy>n d>i d>nh d>ng thong tin d> suy lu>n
cac thong tin khac nhau trong tai li>u du>c nh>p vao. Vi
d> chi>u dai ph> thu>c vao d> phan gi>i (Chi>u dai
tinh theo s> di>m >nh). Cac l>a ch>n bao g>m:
cybookg3, cybook_opus, default, hanlinv3, hanlinv5, illiad,
irexdr1000, irexdr800, kindle, msreader, mobipocket, nook, sony,
sony300, sony900
--list-recipes
List builtin recipe names. You can create an e-book from a
builtin recipe like this: ebook-convert "Recipe Name.recipe"
output.epub
--output-profile
Specify the output profile. The output profile tells the
conversion system how to optimize the created document for the
specified device. In some cases, an output profile can be used
to optimize the output for a particular device, but this is
rarely necessary. Choices are:cybookg3, cybook_opus, default,
generic_eink, generic_eink_hd, generic_eink_large, hanlinv3,
hanlinv5, illiad, ipad, ipad3, irexdr1000, irexdr800, jetbook5,
kindle, kindle_dx, kindle_fire, kindle_oasis, kindle_pw,
kindle_pw3, kindle_scribe, kindle_voyage, kobo, msreader,
mobipocket, tablet, nook, nook_color, nook_hd_plus,
pocketbook_inkpad3, pocketbook_lux, pocketbook_hd,
pocketbook_900, pocketbook_pro_912, galaxy, sony, sony300,
sony900, sony-landscape, sonyt3
--version
show program's version number and exit
TU> CH>N NH>P
Cac tu> ch>n di>u ch>nh x> ly c>a t>p tin nh>p mobi
--input-encoding
Xac d>nh b>ng ma c>a t>p tin du>c nh>p vao. N>u
du>c thi>t l>p, tu> ch>n nay s> ghi de m>i b>ng
ma du>c khai trong chinh t>p tin do. Thich h>p cho cac
t>p tin khong neu ro b>ng ma ho>c g>p l>i trong qua
trinh xac d>nh b>ng ma.
TU> CH>N XU>T
Cac tu> ch>n di>u ch>nh x> ly c>a t>p tin xu>t epub
--dont-split-on-page-breaks
Turn off splitting at page breaks. Normally, input files are
automatically split at every page break into two files. This
gives an output e-book that can be parsed faster and with less
resources. However, splitting is slow and if your source file
contains a very large number of page breaks, you should turn off
splitting on page breaks.
--epub-flatten
This option is needed only if you intend to use the EPUB with
FBReaderJ. It will flatten the file system inside the EPUB,
putting all files into the top level.
--epub-inline-toc
Insert an inline Table of Contents that will appear as part of
the main book content.
--epub-max-image-size
The maximum image size (width x height). A value of none means
use the screen size from the output profile. A value of profile
means no maximum size is specified. For example, a value of
100x200 will cause all images to be resized so that their width
is no more than 100 pixels and their height is no more than 200
pixels. Note that this only affects the size of the actual image
files themselves. Any given image may be rendered at a different
size depending on the styling applied to it in the document.
--epub-toc-at-end
Put the inserted inline Table of Contents at the end of the book
instead of the start.
--epub-version
The version of the EPUB file to generate. EPUB 2 is the most
widely compatible, only use EPUB 3 if you know you actually need
it.
--extract-to
Extract the contents of the generated EPUB file to the specified
folder. The contents of the folder are first deleted, so be
careful.
--flow-size
Split all HTML files larger than this size (in KB). This is
necessary as most EPUB readers cannot handle large file sizes.
The default of 260KB is the size required for Adobe Digital
Editions. Set to 0 to disable size based splitting.
--no-default-epub-cover
Thong thu>ng, n>u cac t>p tin ngu>n khong co bia sach va
b>n khong ch> d>nh tru>c, m>t bia m>c d>nh du>c
t>o ra v>i tieu d>, tac gi>,...Ch>n d> vo hi>u hoa
ch>c nang nay.
--no-svg-cover
Khong s> d>ng SVG cho bia sach. Ch>n n>u EPUB c>a
b>n s> du>c s> d>ng tren m>t thi>t b> khong h>
tr> SVG, nhu iPhone hay JetBook Lite. N>u khong ch>n,
nh>ng thi>t b> tren s> hi>n th> bia nhu la m>t
trang tr>ng.
--preserve-cover-aspect-ratio
When using an SVG cover, this option will cause the cover to
scale to cover the available screen area, but still preserve its
aspect ratio (ratio of width to height). That means there may be
white borders at the sides or top and bottom of the image, but
the image will never be distorted. Without this option the image
may be slightly distorted, but there will be no borders.
--pretty-print
N>u du>c thi>t l>p, plugin xu>t d> li>u s> t>o
t>p tin xu>t d> d>c nh>t co th>. Co th> khong co
hi>u l>c v>i m>t s> plugin xu>t d> li>u.
--toc-title
Title for any generated inline table of contents.
LOOK AND FEEL
Cac tu> ch>n di>u ch>nh theo tr>i nghi>m cho t>p tin
xu>t
--asciiize
Transliterate Unicode characters to an ASCII representation. Use
with care because this will replace Unicode characters with
ASCII. For instance it will replace "Pele" with "Pele". Also,
note that in cases where there are multiple representations of a
character (characters shared by Chinese and Japanese for
instance) the representation based on the current calibre
interface language will be used.
--base-font-size
The base font size in pts. All font sizes in the produced book
will be rescaled based on this size. By choosing a larger size
you can make the fonts in the output bigger and vice versa. By
default, when the value is zero, the base font size is chosen
based on the output profile you chose.
--change-justification
Thay d>i cach canh l> ch>. Gia tr> "left": canh l>
trai. Gia tr> "justify": canh d>u. Gia tr> "original"
(m>c d>nh) gi> nguyen l> tai li>u trong t>p tin
d>u vao. Chu y: Ch>c nang canh l> ch> co trong m>t vai
d>nh d>ng xu>t.
--disable-font-rescaling
Khong t> d>i c> font
--embed-all-fonts
Embed every font that is referenced in the input document but
not already embedded. This will search your system for the
fonts, and if found, they will be embedded. Embedding will only
work if the format you are converting to supports embedded
fonts, such as EPUB, AZW3, DOCX or PDF. Please ensure that you
have the proper license for embedding the fonts used in this
document.
--embed-font-family
Embed the specified font family into the book. This specifies
the "base" font used for the book. If the input document
specifies its own fonts, they may override this base font. You
can use the filter style information option to remove fonts from
the input document. Note that font embedding only works with
some output formats, principally EPUB, AZW3 and DOCX.
--expand-css
By default, calibre will use the shorthand form for various CSS
properties such as margin, padding, border, etc. This option
will cause it to use the full expanded form instead. Note that
CSS is always expanded when generating EPUB files with the
output profile set to one of the Nook profiles as the Nook
cannot handle shorthand CSS.
--extra-css
Either the path to a CSS stylesheet or raw CSS. This CSS will be
appended to the style rules from the source file, so it can be
used to override those rules.
--filter-css
A comma separated list of CSS properties that will be removed
from all CSS style rules. This is useful if the presence of some
style information prevents it from being overridden on your
device. For example: font-family,color,margin-left,margin-right
--font-size-mapping
Mapping from CSS font names to font sizes in pts. An example
setting is 12,12,14,16,18,20,22,24. These are the mappings for
the sizes xx-small to xx-large, with the final size being for
huge fonts. The font rescaling algorithm uses these sizes to
intelligently rescale fonts. The default is to use a mapping
based on the output profile you chose.
--insert-blank-line
Chen m>t dong tr>ng gi>a cac do>n tai li>u. Khong co
tac d>ng n>u t>p tin d>u vao khong s> d>ng do>n
(th>
ho>c
).
--insert-blank-line-size
Set the height of the inserted blank lines (in em). The height
of the lines between paragraphs will be twice the value set
here.
--keep-ligatures
Preserve ligatures present in the input document. A ligature is
a combined character of a pair of characters like ff, fi, fl et
cetera. Most readers do not have support for ligatures in their
default fonts, so they are unlikely to render correctly. By
default, calibre will turn a ligature into the corresponding
pair of normal characters. Note that ligatures here mean only
unicode ligatures not ligatures created via CSS or font styles.
This option will preserve them instead.
--line-height
The line height in pts. Controls spacing between consecutive
lines of text. Only applies to elements that do not define their
own line height. In most cases, the minimum line height option
is more useful. By default no line height manipulation is
performed.
--linearize-tables
M>t s> tai li>u du>c lam c>u th> dung b>ng d>
di>u ch>nh v> tri ch> tren trang. Khi chuy>n d>i
sang d>nh d>ng khac, cac tai li>u nay thu>ng co ch>
n>m ngoai trang va cac l>i khac. Tu> ch>n nay s> tach
n>i dung trong cac b>ng do va s>p x>p du>i d>ng
li>t ke.
--margin-bottom
Set the bottom margin in pts. Default is 5.0. Setting this to
less than zero will cause no margin to be set (the margin
setting in the original document will be preserved). Note: Page
oriented formats such as PDF and DOCX have their own margin
settings that take precedence.
--margin-left
Set the left margin in pts. Default is 5.0. Setting this to less
than zero will cause no margin to be set (the margin setting in
the original document will be preserved). Note: Page oriented
formats such as PDF and DOCX have their own margin settings that
take precedence.
--margin-right
Set the right margin in pts. Default is 5.0. Setting this to
less than zero will cause no margin to be set (the margin
setting in the original document will be preserved). Note: Page
oriented formats such as PDF and DOCX have their own margin
settings that take precedence.
--margin-top
Set the top margin in pts. Default is 5.0. Setting this to less
than zero will cause no margin to be set (the margin setting in
the original document will be preserved). Note: Page oriented
formats such as PDF and DOCX have their own margin settings that
take precedence.
--minimum-line-height
The minimum line height, as a percentage of the element's
calculated font size. calibre will ensure that every element has
a line height of at least this setting, irrespective of what the
input document specifies. Set to zero to disable. Default is
120%. Use this setting in preference to the direct line height
specification, unless you know what you are doing. For example,
you can achieve "double spaced" text by setting this to 240.
--remove-paragraph-spacing
Xoa kho>ng tr>ng gi>a cac do>n tai li>u. D>ng th>i
th>t vao d>u do>n m>t kho>ng 1.5em. N>u t>p tin
d>u vao khong s> d>ng do>n (th>
ho>c
),
ph>n m>m khong th> xoa kho>ng tr>ng.
--remove-paragraph-spacing-indent-size
When calibre removes blank lines between paragraphs, it
automatically sets a paragraph indent, to ensure that paragraphs
can be easily distinguished. This option controls the width of
that indent (in em). If you set this value negative, then the
indent specified in the input document is used, that is, calibre
does not change the indentation.
--smarten-punctuation
Convert plain quotes, dashes and ellipsis to their
typographically correct equivalents. For details, see
https://daringfireball.net/projects/smartypants.
--subset-embedded-fonts
Subset all embedded fonts. Every embedded font is reduced to
contain only the glyphs used in this document. This decreases
the size of the font files. Useful if you are embedding a
particularly large font with lots of unused glyphs.
--transform-css-rules
Path to a file containing rules to transform the CSS styles in
this book. The easiest way to create such a file is to use the
wizard for creating rules in the calibre GUI. Access it in the
"Look & feel->Transform styles" section of the conversion
dialog. Once you create the rules, you can use the "Export"
button to save them to a file.
--transform-html-rules
Path to a file containing rules to transform the HTML in this
book. The easiest way to create such a file is to use the wizard
for creating rules in the calibre GUI. Access it in the "Look &
feel->Transform HTML" section of the conversion dialog. Once you
create the rules, you can use the "Export" button to save them
to a file.
--unsmarten-punctuation
Convert fancy quotes, dashes and ellipsis to their plain
equivalents.
HEURISTIC PROCESSING
Modify the document text and structure using common patterns. Disabled
by default. Use --enable-heuristics to enable. Individual actions can
be disabled with the --disable-* options.
--disable-dehyphenate
Analyze hyphenated words throughout the document. The document
itself is used as a dictionary to determine whether hyphens
should be retained or removed.
--disable-delete-blank-paragraphs
Remove empty paragraphs from the document when they exist
between every other paragraph
--disable-fix-indents
Turn indentation created from multiple non-breaking space
entities into CSS indents.
--disable-format-scene-breaks
Left aligned scene break markers are center aligned. Replace
soft scene breaks that use multiple blank lines with horizontal
rules.
--disable-italicize-common-cases
Look for common words and patterns that denote italics and
italicize them.
--disable-markup-chapter-headings
Detect unformatted chapter headings and sub headings. Change
them to h2 and h3 tags. This setting will not create a TOC, but
can be used in conjunction with structure detection to create
one.
--disable-renumber-headings
Looks for occurrences of sequential
or tags. The tags
are renumbered to prevent splitting in the middle of chapter
headings.
--disable-unwrap-lines
Unwrap lines using punctuation and other formatting clues.
--enable-heuristics
Enable heuristic processing. This option must be set for any
heuristic processing to take place.
--html-unwrap-factor
Scale used to determine the length at which a line should be
unwrapped. Valid values are a decimal between 0 and 1. The
default is 0.4, just below the median line length. If only a
few lines in the document require unwrapping this value should
be reduced
--replace-scene-breaks
Replace scene breaks with the specified text. By default, the
text from the input document is used.
SEARCH AND REPLACE
Modify the document text and structure using user defined patterns.
--search-replace
Path to a file containing search and replace regular
expressions. The file must contain alternating lines of regular
expression followed by replacement pattern (which can be an
empty line). The regular expression must be in the Python regex
syntax and the file must be UTF-8 encoded.
--sr1-replace
Replacement to replace the text found with sr1-search.
--sr1-search
Search pattern (regular expression) to be replaced with
sr1-replace.
--sr2-replace
Replacement to replace the text found with sr2-search.
--sr2-search
Search pattern (regular expression) to be replaced with
sr2-replace.
--sr3-replace
Replacement to replace the text found with sr3-search.
--sr3-search
Search pattern (regular expression) to be replaced with
sr3-replace.
STRUCTURE DETECTION
Di>u ch>nh t> d>ng nh>n d>ng c>u truc van b>n.
--add-alt-text-to-img
When an tag has no alt attribute, check the associated
image file for metadata that specifies alternate text, and use
it to fill in the alt attribute. The alt attribute is used by
screen readers for assisting the visually challenged.
--chapter
An XPath expression to detect chapter titles. The default is to
consider or tags that contain the words "chapter",
"book", "section", "prologue", "epilogue" or "part" as chapter
titles as well as any tags that have class="chapter". The
expression used must evaluate to a list of elements. To disable
chapter detection, use the expression "/". See the XPath
Tutorial in the calibre User Manual for further help on using
this feature.
--chapter-mark
Ch> ra cach danh d>u chuong sach. Gia tr> "pagebreak" s>
chen ng>t trang tru>c m>i chuong. Gia tr> "rule" s>
chen m>t du>ng k> tru>c m>i chuong. Gia tr> "none"
vo hi>u hoa vi>c danh d>u chuong, gia tr> "both" chen
c> ng>t trang va du>ng k> d> danh d>u chuong.
--disable-remove-fake-margins
Some documents specify page margins by specifying a left and
right margin on each individual paragraph. calibre will try to
detect and remove these margins. Sometimes, this can cause the
removal of margins that should not have been removed. In this
case you can disable the removal.
--insert-metadata
Insert the book metadata at the start of the book. This is
useful if your e-book reader does not support
displaying/searching metadata directly.
--page-breaks-before
An XPath expression. Page breaks are inserted before the
specified elements. To disable use the expression: /
--prefer-metadata-cover
Uu tien s> d>ng bia sach du>c tim ra t> t>p tin d>u
vao hon la bia da du>c d>nh tru>c.
--remove-first-image
Remove the first image from the input e-book. Useful if the
input document has a cover image that is not identified as a
cover. In this case, if you set a cover in calibre, the output
document will end up with two cover images if you do not specify
this option.
--start-reading-at
An XPath expression to detect the location in the document at
which to start reading. Some e-book reading programs (most
prominently the Kindle) use this location as the position at
which to open the book. See the XPath tutorial in the calibre
User Manual for further help using this feature.
TABLE OF CONTENTS
Di>u ch>nh qua trinh t> t>o M>c L>c. M>c d>nh, n>u
t>p tin ngu>n da co s>n M>c L>c, no s> du>c s> d>ng
thay vi t> d>ng t>o M>c L>c m>i.
--duplicate-links-in-toc
When creating a TOC from links in the input document, allow
duplicate entries, i.e. allow more than one entry with the same
text, provided that they point to a different location.
--level1-toc
XPath expression that specifies all tags that should be added to
the Table of Contents at level one. If this is specified, it
takes precedence over other forms of auto-detection. See the
XPath Tutorial in the calibre User Manual for examples.
--level2-toc
XPath expression that specifies all tags that should be added to
the Table of Contents at level two. Each entry is added under
the previous level one entry. See the XPath Tutorial in the
calibre User Manual for examples.
--level3-toc
XPath expression that specifies all tags that should be added to
the Table of Contents at level three. Each entry is added under
the previous level two entry. See the XPath Tutorial in the
calibre User Manual for examples.
--max-toc-links
S> lien k>t du>c chen vao M>c L>c. Gan 0 d> vo
hi>u hoa. M>c d>nh: 50. Lien k>t ch> du>c them vao
M>c L>c n>u s> chuong du>c tim ra nh> hon ngu>ng
b>n da ch>n.
--no-chapters-in-toc
Khong them nh>ng chuong du>c ph>n m>m t> tim ra vao
M>c L>c.
--toc-filter
Remove entries from the Table of Contents whose titles match the
specified regular expression. Matching entries and all their
children are removed.
--toc-threshold
N>u s> chuong du>c tim ra nh> hon ngu>ng nay, cac lien
k>t s> du>c them vao M>c L>c. M>c d>nh: 6
--use-auto-toc
Thong thu>ng, n>u t>p tin ngu>n da co s> M>c L>c,
no s> du>c s> d>ng thay cho M>c L>c t> t>o.
Tu> ch>n nay s> khi>n ph>n m>m luon s> d>ng
M>c L>c t> t>o.
METADATA
Tu> ch>n d> gan thong tin mo t> cho t>p tin xu>t
--author-sort
String to be used when sorting by author.
--authors
Gan tac gi>. Ten cac tac gi> ph>i du>c ngan cach b>ng
ky hi>u va (&).
--book-producer
Set the book producer.
--comments
Set the e-book description.
--cover
Gan bia sach t> t>p tin ho>c URL du>c ch> d>nh
--isbn Gan ISBN
--language
Gan ngon ng>
--pubdate
Set the publication date (assumed to be in the local timezone,
unless the timezone is explicitly specified)
--publisher
Set the e-book publisher.
--rating
Gan di>m s>. Phai la m>t s> t> 1 d>n 5
--read-metadata-from-opf, --from-opf, -m
D>c thong tin mo t> t> t>p tin OPF du>c ch> d>nh.
Thong tin mo t> du>c d>c t> t>p tin nay s> ghi de
thong tin mo t> trong t>p tin d>u vao.
--series
Set the series this e-book belongs to.
--series-index
Gan th> t> trong b> sach
--tags Gan th> cho sach. Gi>a cac th> ph>i co d>u ph>y.
--timestamp
Set the book timestamp (no longer used anywhere)
--title
Gan T>a sach
--title-sort
The version of the title to be used for sorting.
DEBUG
Tuy ch>n giup g> l>i cho vi>c chuy>n d>i
--debug-pipeline, -d
Save the output from different stages of the conversion pipeline
to the specified folder. Useful if you are unsure at which stage
of the conversion process a bug is occurring.
--verbose, -v
Level of verbosity. Specify multiple times for greater
verbosity. Specifying it twice will result in full verbosity,
once medium verbosity and zero times least verbosity.
AUTHOR
Kovid Goyal
COPYRIGHT
Kovid Goyal
7.17.0 thang 8 23, 2024 EBOOK-CONVERT(1)