1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/hf-hf-kindle-helper

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
README.md 2.7 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
Отправлено 06.03.2025 00:55 7fe4262

kindle-helper

English version

Project description

Kindle-helper is a Java library that allows for quick creation of e-books in the .mobi format with covers and content.

Environment requirements

  • JDK 1.8+
  • Maven 3.0+

How it works

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.

Important information

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

Usage instructions

Create a Book object and fill it with chapters. After this, call the appropriate method to generate the file.

Creating .mobi

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.

Creating .txt

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

Временная локальная репозитория Maven

Добавьте следующую конфигурацию в ваш 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>

Обновление v0.0.5

Улучшена визуализация, исправлены некоторые ошибки, добавлена поддержка загрузки изображений из локального пути.

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/hf-hf-kindle-helper.git
git@api.gitlife.ru:oschina-mirror/hf-hf-kindle-helper.git
oschina-mirror
hf-hf-kindle-helper
hf-hf-kindle-helper
master