Library organization on PC / reader | PC Applications | fb2converter [Other]



Rep: (42)
fb2converter - Library organization on PC / reader | PC applications
Supported platforms: Windows, MacOS, Linux

Discussion of the converter was originally conducted onthe-ebook.org (the resource is closed from March 1, 2019) and here in the subject Library organization on PC / reader .

In order not to litter the topic "Organization of the Library", further discussion will be conducted here.

This program is an iteration of the project.fb2mobi and is the result of summarizing the experience gained in the process of supporting fb2mobi. The main reasons for its creation are the difficulties in supporting binary distributions of code written in Python, as well as historical stratifications on the command line and fb2mobi configuration. Discussion fb2mobi conducted here .

fb2c has no dependencies and does not require installation. During the processing, an attempt was made to separate the command line from the configuration file, simplified the configuration and normalized the use of Unicode. Removed or simplified fb2mobi (XSLT, custom dictionaries) features that nobody used. At the same time, everything connected with the visual formatting of the book (stylesheets, etc.) remains practically unchanged. Accordingly the documentation forfb2mobiin partdocument formattingstill relevant.

Currently, fb2c can do more than the fb2mobi command line.

Some differences from fb2mobi, worthy of mention:
  • Changed the algorithm for processing the names of the received files (you can list in the directory by metadata)
  • Processes files within directories and archives, allows flexible definition of the name and path of the resultant (s)
  • Somewhat different hyphenation algorithm
  • golang runtime handles images somewhat differently than Python - so some broken images will become more visible (there is use_broken_images in the configuration)
  • Page size is calculated in Unicode code points and not in bytes.
  • Changed the generation of table of contents for epub (toc.ncx), expanded the formatting capabilities of the displayed table of contents
  • Added new text formatting features.
  • Kobo KEPUB format supported
  • The generated epub is being tested.epubcheck

Project site
Latest binaries
Attempt to documentation

Shell / GUI with full integration
  • Multi-platform GUI (and not only) to fb2converter fromdnk_dz - libro
  • Windows program for managing collections of electronic books in any format -MyHomeLib

For those who forgot the command line, a brief reminder on the convert command:
Attached Image


The logic of work looks like this: if you want to customize something, select a location, use the export command, change how you like it and specify the path to your configuration in the selected location when starting the program. Otherwise, the built-in values ​​are the default configuration. The program does not pick up anything anywhere from the disk itself. I do not know where it will work and how you feel comfortable, and I don’t want to know.

Short instruction fromeliy for the lazy
1. Download the archive here
2. We read documentationhere
3. Unpack in some folder, for example C: \ fb2c
4. Run the terminal WIN + R and cmd.exe
5. go to the folder with the cd c: \ fb2c \ fb2converter program (if I'm not mistaken, but you can look in the explorer for the correct path to fb2c.exe)
6. Execute "fb2c.exe export."
7. Settings files, styles, vignettes, etc. will appear in the program folder. which can be edited.


Post has been editedrupor123 - 02.04.19, 13:53



Rep: (233)
Write, please, somebody, continuation of the instruction for lazy. I tried to do by analogy from this post -Library organization on a PC / reader (Post eliy # 82418056), nothing succeeded.
The goal is simple: to convert fb2 files from the k: \ book_fb2 folder to an epub or kepub folder in the k: \ book_epub folder, with all the subfolders.
I wrote such a command, but somewhere an error is - k: \ fb2c-win64 \ fb2converter \ fb2c.exe -c configuration.toml convert --to kepub k: \ book_fb2 k: \ book_epub
Attached Image

thank you in advance.

Post has been editedSylvia - 19.02.19, 00:57



Rep: (42)
The program cannot find the configuration file. Try first simply "k: \ fb2c-win64 \ fb2converter \ fb2c.exe convert - to kepub k: \ book_fb2 k: \ book_epub". If it works, look for where you put the configuration.toml and specify the full path to it :)



Rep: (233)
If it works, look for where you put the configuration.toml and specify the full path to it.

Works: yes2:. configuration.toml did not move anywhere, it was where it was originally - k: \ fb2c-win64 \ fb2converter \. Thank you very much, I will try to specify the full path.
It turned out that -c is superfluous.
Is it possible to get an epub at the output, and not a kepub? At kepub, there is one significant (for me) minus - the number of pages = number of screens, while at epub it is always the same, regardless of the font size.

Post has been editedSylvia - 19.02.19, 08:25



Rep: (665)
Sylvia @ 02/19/19 1:49*
It turned out that -c is too much

Without -c configuration.toml your config is not used. Uses a built-in program with default settings.
Sylvia @ 02/19/19 1:49*
Is it possible to get an epub on the output

--to epub

k: \ fb2c-win64 \ fb2converter \ fb2c.exe -c k: \ fb2c-win64 \ fb2converter \ configuration.toml convert --to epub k: \ book_fb2 k: \ book_epub


Well, or to start go to k: \ fb2c-win64 \ fb2converter \
And then convert.
1. cd k: \ fb2c-win64 \ fb2converter \
2. fb2c.exe -c configuration.toml convert --to epub k: \ book_fb2 k: \ book_epub


You can even make a cmd file which will run it automatically. You will only need to throw books into the k: \ book_fb2 folder and pick up the result from k: \ book_epub after it starts.

If you re-convert a file that has already been converted, by default, the program is prohibited from replacing an existing file with a new version of the same file. This can be canceled with the --ow option.
Therefore, when debugging and setting up for multiple conversions of the same file with different options and styles, you must either delete the result each time, or rename or add --ow, for example, after --to epub like this:

k: \ fb2c-win64 \ fb2converter \ fb2c.exe -c k: \ fb2c-win64 \ fb2converter \ configuration.toml convert --to epub --ow k: \ book_fb2 k: \ book_epub

Otherwise, the program will work, but the file will be all the one that was after the first conversion, and in the log you will see an error that a file with that name already exists in the folder for the result.
Sylvia @ 02/19/19, 0:56*
I tried to do by analogy from this post - Organization of the library on a PC / reader (Post eliy # 82418056), nothing happened.

Corrected an example there. Blame ... did not register the path completely ...: blush:

Post has been editedeliy - 20.02.19, 09:27
Reason for editing: Added



Rep: (1)
Good afternoon, tell me in the logs there is a line WARN, what is it?

C: \ fb2c-win64>cd C: \ fb2c-win64 \ fb2converter

C: \ fb2c-win64 \ fb2converter>fb2c.exe -c c: \ fb2c-win64 \ fb2converter \ default.toml convert --to mobi --ow c: \ fb2c-win64 \ book_fb2 \ c: \ fb2c-win64 \ book_mobi
2019-02-19T15: 51: 15.348 + 0500 INFO Processing starting {"source": "c: \\ fb2c-win64 \\ book_fb2", "destination": "c: \\ fb2c-win64 \\ book_mobi", " format ":" mobi "}
2019-02-19T15: 51: 15.349 + 0500 INFO Conversion starting {"from": "\\ ucheniki-vorona-seyateli-vetra.fb2"}
2019-02-19T15: 51: 15.431 + 0500 WARNING image / jpeg "}



Rep: (665)
DOCTORPASHA @ 02/19/19, 1:54*
Declared and detected types {"id": "cover.jpg", "declared": "image / jpg", "detected": "image / jpeg"}

The file contains cover.jpg, and in fact jpeg files ... in fact, nothing important or terrible, the author of the file is to blame.

Post has been editedeliy - 19.02.19, 14:13



Rep: (42)
DOCTORPASHA @ 02.19.19, 05:54*
Declared and detected image not match

eliy @ 02.19.19, 06:10*
essentially nothing important or scary, the author of the file is to blame

Yes, the mime type "image / jpg" is not available in nature - there is only "image / jpeg". This is an easy case, often put jpeg, and he actually png. It happens and vice versa. In general, WARN is not a cause for concern, so diagnostics.

Post has been editedrupor123 - 19.02.19, 14:40



Rep: (87)
Sylvia @ 02/19/19 04:49 AM*
Kepub has one significant (for me) minus - the number of pages = number of screens
it is not, checked just in case - when you increase the font, the same page number is put on more screens, i.e. You can adjust the font so that one screen = one page, and you can ten screens = one page.



Rep: (233)
Thanks uv.* rupor123, and * eliy,
everything worked out! : thank_you:
And most importantly, for some reason, now in kepub there is a fixed number of pages! : clap:
It remains to learn how to embed your font: sveta:
I studied this topic -https://github.com/rup...D1%82%D0%BE%D0%B2#toc3
But there were questions. In the fb2c-win64 \ fb2converter \ profiles \ fonts \ folder I threw my fonts.
Added lines to default.kepub.css

body {
font-family: Helvetica;
line-height: 100%;
What is wrong doing? Need to write the name of the font with the extension, maybe in quotes? (tried - nothing changes) Or, still need to edit the configuration.toml?
* SHELLS, right, you are right. This is something I jiggled, probably because the toml file was not taken into account.

Post has been editedSylvia - 19.02.19, 16:01



Rep: (665)
Sylvia @ 02.19.19, 15:55*
Added lines to default.kepub.css


not. First declare the enumeration of fonts for all faces, the path and name with the extension without errors

@ font-face {
font-family: "paragraph";
src: url ("profiles / fonts / Bannikova-Regular.ttf");
}
@ font-face {
font-family: "paragraph";
src: url ("profiles / fonts / Bannikova-Italic.ttf");
font-style: italic;
}
@ font-face {
font-family: "paragraph";
src: url ("profiles / fonts / Bannikova-Bold.ttf");
font-weight: bold;
}
@ font-face {
font-family: "paragraph";
src: url ("profiles / fonts / Bannikova-ItalicBold.ttf");
font-style: italic;
font-weight: bold;
}

Further, in the css for those formatting elements where you need to add the parameter

font-family: "paragraph"
Here is a part of my file, to understand the meaning, it is not necessary to copy it, you need to edit your file, adding the line font-family: "paragraph" where necessary

.epigraph {
font-family: "paragraph";
margin-left: 4em;
text-align: right;
margin-top: 0.4em;
margin-bottom: 0.2em;
font-style: italic;
}
.text-author {
font-family: "paragraph";
page-break-before: avoid;
text-align: right;
font-weight: bold;
}

.subtitle {
font-family: "paragraph";
page-break-after: avoid;
text-align: center;
font-weight: bold;
margin-bottom: 0.5em;
margin-top: 1em;
}

p {
font-family: "paragraph";
text-indent: 1.4em;
margin-bottom: 0pt;
margin-top: 0pt;
text-align: justify;
}

p.title {
font-family: "paragraph";
text-indent: 0em;
text-align: center;
}

.poem {
font-family: "paragraph";
text-indent: 0em;
margin-left: 0.5em;
margin-bottom: 0em;
margin-top: 0em;
font-style: normal;
text-align: left;
}


.poem p {
font-size: 80%;
margin-bottom: 0em;
margin-top: 0em;
font-family: "paragraph";
}

.table td {
font-family: "paragraph";
border: 1px solid black;
}

.annotation {
font-family: "paragraph";
margin-right: 1em;
margin-left: 1em;
font-size: 80%;
text-align: center;
margin-top: 2em;
margin-bottom: 1em;
}

span.dropcaps {
font-family: "paragraph";
float: left;
font-weight: bold;
font-size: 3em;
margin-top: 0em;
margin-bottom: -0.2em;
margin-right: 0.08em;
padding-right: .1em;
}

Then in the configuration.toml specify in the section
[document]
style = "profiles / default.kebub.css"
And the font should be embedded.

Post has been editedeliy - 19.02.19, 20:28



Rep: (152)
* Sylvia
you cannot do it, because you have not uncommented and have not changed profiles / default.kebub.css
eliy @ 02.19.19, 16:21*
First declare the enumeration of fonts for all faces.
What for? I am not familiar with this converter, but logically enough to add

body {
font-family: "Helvetica"
{

Then throw Helvetica in the fonts folder in the root of Kobo, and that's it.

Choose in the settings Font publisher or Helvetica, once. Is not it?

I do not really understand the meaning of his embedding for Sylvia, but, probably, she knows better.

ZY it makes sense to build in when the book uses different fonts, and here, it seems, is not the case. It turns out only the extra weight of the file, why?

Post has been edited.qwerty - 19.02.19, 17:07



Rep: (233)
.qwerty @ 19.02.19, 15:45*
I do not really understand the meaning of his embedding for Sylvia, but, probably, she knows better.
I want to convert hudlit with one font, all sorts of scientific and educational - with another. Such a bzik. : blush: Helvetica is just an example.



Rep: (87)
* Sylvia Fully embed a font - to increase the file size, in each one stuffing the same font, this is usually done so that regardless of the presence on the device of the font or its capabilities, the text is displayed as you intended. In Kobo, indeed, can be easier, as written above * .qwerty,
Like that
body {
font-family: "Charter", "Georgia", "Bookerly";
line-height: 100%;
}

Line-height is optional, the reader should have one of the listed fonts, the first one found from left-to-right will be used.
Also with a letter, if necessary:
span.dropcaps {
font-family: "Lombardina Initial One", "Georgia", "Bookerly";
font-size: 3.5em;
float: left;
margin-top: -.3em;
margin-bottom: -.5em;
margin-right: 0em;
padding-right: .1em;
}

If you still want to fully embed the font, i.e. put in each book the font files, you need to specify where to get the font - do as I wrote* eliy , do not forget that by default all paths to files are calculated from the location of the specified configuration file, the only thing I would write, as in the documentation, without a dot and a slash:
@ font-face {
font-family: "family_name";
src: url ("profiles / fonts / Bannikova-Regular.ttf");
}



Rep: (152)
Sylvia @ 02.19.19, 17:17*
I want to convert hudlit with one font, all sorts of scientific and educational - with another. Such a bzik
You make kepub - that is, for Kobo definitely, just add these two fonts to the fonts folder and that's it. The fact thateliy I wrote it down if there are several fonts in one book, for example, the main text is one, and the epigraph is different. You just don't need it.

You - uncomment the profile / default.kebub.css line in configuration.toml and write in css

body {
font-family: "Helvetica"
{

in science cognitive and

body {
font-family: "other_font"
{

in hudlite (or vice versa).
SLOPE @ 19.02.19, 17:22*
line-height optional
Just do not need, it is leading.

Post has been edited.qwerty - 19.02.19, 17:50



Rep: (233)
* eliy , * SLOTHEADS , * .qwerty , thank you very much for the instructions, I will try in the evening, as I get to the company.



Rep: (87)
.qwerty @ 19.02.19, 20:24*
Just do not need, it is leading.
You do not need? do not use. I sometimes change, but I think who will need it - will figure out what he needs and why.



Rep: (152)
SLOPE @ 19.02.19, 17:31*
You do not need? do not use
We're talking about Kobo and discussing Sylvia’s books, no? Leading changes in the settings of Kobo, if desired.

You - change, and if she needs, she will write.
* SHELLS,
but you can find out what and why you are registering
SLOPE @ 19.02.19, 17:31*
sometimes change
as well ashere, nothing will change. At least in%, even in units.

Or I'm wrong?

Post has been edited.qwerty - 19.02.19, 20:15



Rep: (665)
SLOPE @ 19.02.19, 17:22*
The only thing I would write, as in the documentation, without a dot and a slash:

It makes no difference, and so it works, but once in the documentation without a dot and a slash, I corrected the post.

Post has been editedeliy - 19.02.19, 20:28



Rep: (42)
It is possible with a point, without, a full absolute path is possible - but in the latter case it becomes dependent on the system, where fb2c is wound



Rep: (233)
Thank you all, it turned out to convert a bunch of files, along with folders. The only caveat is that if some fb2 curve is encountered, the program stumbles on it, and the conversion does not go any further. Somehow to think that this file is just skipped. But this is nagging, of course. Everything is perfect, respect the author!


Full version    

Help     rules

Now: 07/05/19, 14:51