Kindle-helper is a Java library that allows for quick creation of e-books in the .mobi format with covers and content.
Kindle-helper uses a set of templates to create .opf files and other necessary files for book generation, after which it launches KindleGen to convert into the .mobi format.
Due to build size limitations, the library does not include KindleGen. Therefore, before running the program, ensure that KindleGen is located in the /bin directory next to the jar file. You can also specify another path to an external KindleGen through the constructor of MobiWriter.
Official page for downloading KindleGen
Create a Book object and fill it with chapters. After this, call the appropriate method to generate the file.
Create a MobiWriter object by passing it a Book object for generating .mobi. To add a cover image, use the MobiWriter constructor with the parameter coverUrl. Only remote location of images is supported.
Create a TxtWriter object by passing it a Book object for generating .txt.## Примеры экранов
Book book = new Book();
ChapterInfo chapterInfo = new ChapterInfo();
//...Заполнение Book и chapterInfo
book.setChapters(new ChapterInfo[]{chapterInfo});
Writer writer = new MobiWriter();
writer.generate(book, "D:\\tmp3");
Дополнительные примеры см. в Main.java
Добавьте следующую конфигурацию в ваш pom.xml:
<repositories>
<repository>
<id>mvnrepo</id>
<name>mvn repository</name>
<url>https://gitee.com/hf-hf/mvnrepo/blob/master</url>
</repository>
</repositories>
После этого добавьте зависимость kindle-helper:
<dependency>
<groupId>top.hunfan</groupId>
<artifactId>kindle-helper</artifactId>
<version>0.0.5</version>
</dependency>
Улучшена визуализация, исправлены некоторые ошибки, добавлена поддержка загрузки изображений из локального пути.
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Опубликовать ( 0 )